Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Tables & Charts


Thread Tools Search this Thread Display Modes
Old August 7th, 2018, 08:36 AM
mclisa81 mclisa81 is offline
Regular Contributor
Join Date: Oct 2008
Location: Manchester CT
Posts: 97
Default Table vertical spacing help

This is a job we've done for years and they're trying to keep as much of it as "static" as possible. Only the Dates and Month/Year are to be variable components.

I came in with a clear head ... found and fixed a few issues in my rule, but I'm still fighting with the same problems. Revised and re-uploaded the files. If anyone was looking into my first files, that's fine. I didn't change much and any help with them would be welcomed.

All of these are for the calendars at the bottom of the page.

When I use "AddColumns" and put in 7 different column widths, the leading between the dates messes up, but my columns align where I want them. When I use "AddColumn", which allows only 1 column, that fixes the leading between my dates, but the columns don't align. See p2 in the template for what I'm looking for.

I have white boxes behind the calendar dates to knockout the static rules. I know how to suppress boxes, but I just don't know where/how to add this to the calendar function. There are 13 boxes I believe this could happen on, the first 6 on the top row and the complete bottom row. See p2 in the template for what I'm looking for.

Not sure about the table width error either. I added up the columns and they don't exceed my frame widths. I opened up the text frames and still get the errors. I don't think this is messing anything up, just throwing an error.

As always, any help is appreciated and thanks in advance!!
Attached Files
File Type: zip 14288_LM_Deskcal_template.zip (318.6 KB, 10 views)

Last edited by mclisa81; August 8th, 2018 at 05:16 AM.. Reason: Changes
Reply With Quote
Old August 8th, 2018, 11:17 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,467
Default Re: Table vertical spacing help

You're close. Your function as-is does this, at line 75 of the JavaScript Globals:
    var table = new FPTable();
    for (var day = 1; day <= 7; day++)
//      table.AddColumn(1680);
You're actually adding 49 columns here, seven columns at a time, in seven iterations of the for loop. That's why you get the message that the table is wider than the frame, because it has 49 columns (even though all but the first seven columns have no content). Though it's just a warning message, and FusionPro will still typeset a table that's larger than the frame.

What you're missing is that the AddColumn and AddColumns functions both do exactly the same thing. Either function can take multiple parameters, and will make as many columns as you tell it to.

So you really want either this:
    for (var day = 1; day <= 7; day++)
Or this:
    // no for loop here!
Though you probably want the first one, so that all the columns are the same width.

When I do the first one (the for loop that calls AddColumn with a single parameter seven times), I get something which looks okay to me:

Although I don't have your font "Trade Gothic LT Std Light", so it's just setting the numbers in the default Arial font. But I don't really see what's wrong. You say:
Originally Posted by mclisa81 View Post
When I use "AddColumn", which allows only 1 column, that fixes the leading between my dates, but the columns don't align.
Don't align to what? You mean the abbreviations of the day names (Sun, Mon, etc.)? Do you mean they don't align vertically or horizontally?

If it's about the vertical space between the month and day names and the numbers, I think you just need to get rid of some of the superfluous tagging at line 123. I changed this:
    var title = '<p br=false quad=C><z newsize=12><leading newsize=-20>' + MonthName + '<br><br></color></leading>\n';
To this:
    var title = '<p br=false quad=C><z newsize=12>' + MonthName;
And now I get this output:

Again, that looks pretty good to me.

My only other guess as to what you mean by "the columns don't align" is that you don't like that the numbers aren't exactly centered under each day name abbreviation. It seems like you're trying to make the column widths different to match the static example. If I go back to the second version of the code above, with a single call to AddColumns with seven parameters, and NO for loop (and with the change just above to reduce the space between the month name title and the table numbers), I get this:

That seems pretty much spot on to me.

The only other advice I have is that lining up variable and static content like this can be tricky. So you might consider just adding the day names as a row in the table instead.
Attached Images
File Type: jpg table.jpg (13.1 KB, 57 views)
File Type: jpg table2.jpg (17.6 KB, 55 views)
File Type: jpg table3.jpg (20.2 KB, 56 views)
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
Old August 10th, 2018, 07:23 AM
mclisa81 mclisa81 is offline
Regular Contributor
Join Date: Oct 2008
Location: Manchester CT
Posts: 97
Default Re: Table vertical spacing help

Thanks Dan,

After removing the loop (which also fixed the double spacing on all the rows), the alignment is perfect (dates aligning under the days) using:
Note: There's still a "different" spacing issue mentioned below on certain rows.

I think I need to keep this:
var title = '<p br=false quad=C><z newsize=12><leading newsize=-20>' + MonthName + '<br><br></color></leading>\n';
Because, if you preview record 2, row1 is in the perfect position. The whole calendar looks like it should:

However, record 1 does not:

EDITED - I believe the issue with row1 on record 1 is that the empty cells do not have the same Margins or PointSize as the other cells. Is there a way to add Margins (Top and Bottom) and the PointSize to the empty cells? Or, is there a way to change the default Margins and PointSize (without affecting any other FusionPro jobs that is).

I also changed this:
row.Cells[day].VAlign = "Bottom";
to this:
row.Cells[day].VAlign = "Top";
I'm assuming this only "appears" to have fixed record 2 because row5 with empty cells is now Top aligning. However, record 1, since there are empty cells on row1, you see the extra space below. I guess it doesn't matter if it's Top or Bottom, if we can get the Margin thing working correctly.

I messed up in my original post by implying I only had questions on the bottom calendars. See boxed area on p2 of the template.

I have white Text Frames behind all the dates that are knocking out the top rule behind the date:

However, if there are empty cells (no dates), I need that Text Frame to be suppressed:

Typically I would just write a rule to suppress if something is empty. However, I don't know where to incorporate that in the Calendar Function. I believe it would only be needed for the first 6 cells of row1 (Frames b1 through b6) and the bottom 7 cells of row5 (Frames b7-b13).

I'm sorry I was less than clear originally. I was rushing, being given extremely short notice to produce this. That's no longer the case, so I can take the time to try and understand everything.

Thank you for your detailed explanations and invaluable help as usual.
Attached Images
File Type: jpg suppress.jpg (4.7 KB, 44 views)
File Type: jpg knockout.jpg (4.7 KB, 44 views)
File Type: jpg rec2.jpg (9.1 KB, 43 views)
File Type: jpg rec1.jpg (9.4 KB, 45 views)
Attached Files
File Type: zip 14288_LM_Deskcal_template3.zip (7.32 MB, 4 views)
Lisa McKillop
Digital Prepress Operator
RR Donnelley Manchester
Windows 10, Acrobat 11.0.3
FusionPro Desktop 10.0.26

Last edited by mclisa81; August 15th, 2018 at 02:22 AM.. Reason: Additional Testing Found PointSize is affecting rows spacing also
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 05:19 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.