mclisa81 Posted August 7, 2018 Posted August 7, 2018 (edited) 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!! Lisa14288_LM_Deskcal_template.zip Edited August 8, 2018 by mclisa81 Changes Quote
Dan Korn Posted August 8, 2018 Posted August 8, 2018 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.AddColumns(1980,1280,2080,1280,2400,980,1880); // 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++) table.AddColumn(1680); Or this: // no for loop here! table.AddColumns(1980,1280,2080,1280,2400,980,1880); 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: http://forums.pti.com/attachment.php?attachmentid=1864&stc=1&d=1533750329 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: 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: http://forums.pti.com/attachment.php?attachmentid=1865&stc=1&d=1533751200 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: http://forums.pti.com/attachment.php?attachmentid=1866&stc=1&d=1533751663 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. Quote
mclisa81 Posted August 10, 2018 Author Posted August 10, 2018 (edited) 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: table.AddColumns(1980,1280,2080,1280,2400,980,1880); 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: http://forums.pti.com/attachment.php?attachmentid=1876&stc=1&d=1534324438 However, record 1 does not: http://forums.pti.com/attachment.php?attachmentid=1877&stc=1&d=1534324438 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: http://forums.pti.com/attachment.php?attachmentid=1875&stc=1&d=1534324438 However, if there are empty cells (no dates), I need that Text Frame to be suppressed: http://forums.pti.com/attachment.php?attachmentid=1874&stc=1&d=1534324438 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.14288_LM_Deskcal_template3.zip Edited August 15, 2018 by mclisa81 Additional Testing Found PointSize is affecting rows spacing also Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.