Hello, is it possible to make a table that display...
# advancedpdf
i
Hello, is it possible to make a table that display a list to fill the whole page, even when there is either none or less than the heigh of the page data to fill?
d
when you say fill, do you mean you want subsequent content to be forced onto a new page, or do you mean you want your list to be evenly spread across the page vertically?
i
I mean that if the list of items only has 2 the table should go all the way down the page with the along with the second table showing the totals but if the items are let’s say 30 and only 15 fit the first page, the remaining should go on the second page also all the way down with the totals. Like this
d
that's an interesting one, let me think..
potentially on the last element in the
<#list>
you could print a bunch of newlines and just let it overflow the current page. Obvs the total table should be done as a BFO footer
in your example of 30 items and only 15 fit on the first page, I'm not sure how to make sure there isn't a gap in the lines between the 15th item and the total table
one alternative, though I'm not necessarily recommending it, is to use a BFO background of a blank table. I'm pretty sure that would work, but may be finicky
i
What I tried to do was counting the total items and depending of the qty, fill the table with a min heigh, but this only for the first page, if there is more items and there is a need for a second..third..etc, this just doesn’t work haha
That image solution sounds interesting 👀
d
The BFO background doesn't have to be an image (see BFO docs: background-macro) so you would just have an actual table in the background, using the same column widths as your item table. You'd then need to size/position it correctly to account for the header and footer. Actually, you know what, that might be the easiest thing to do.
i
Yeah, that sounds like the best solution 😃
d
would be keen to know if you get it to work/see a screenshot =] good luck!
i
Yeah will update once it’s done!! Thanks @David B
s
@irurzo We can talk I wouldn't call it 'solved' but I did a workaround where I created a freemarker variable that depending on the item line count, it prints n lines And e.g. If 1 item, prints 10 blank rows If 2 items, prints 9 blank rows etc... If 9 items, prints 1 blank row If > 10 items, the table is just normal as it will spill over to the next page. And all 10 one-page possibilities have 'almost' the same table height. The point is the table takes up the full height.
There's other workaround but THIS issue and the "print a footer only on last page of multipage PDF" are the two most glaring issues for Netsuite PDFs