Hello everyone, I am working on an advanced pdf t...
# general
s
Hello everyone, I am working on an advanced pdf template and I went with just putting everything on 1 table with no special css or such. Problem is, there is no error but if an invoice has 3 items, when printing it is being rendered individually on a page. Any thoughts?
p
whats your table look like?
<table style="width: 100%; margin-top: 10px;"><!-- start items --><#list record.item as item><#if item_index==0>
<thead> <tr> <th align="center" colspan="3" style="padding: 10px 6px;">${item.quantity@label}</th> <th colspan="12" style="padding: 10px 6px;">${item.item@label}</th> <th align="right" colspan="4" style="padding: 10px 6px;">${item.rate@label}</th> <th align="right" colspan="4" style="padding: 10px 6px;">${item.amount@label}</th> </tr> </thead> </#if><tr> <td align="center" colspan="3" line-height="150%">${item.quantity}</td> <td colspan="12"><span style="font-weight: bold; line-height: 150%; color: #333333;">${item.item}</span><br />${item.description}</td> <td align="right" colspan="4">${item.rate}</td> <td align="right" colspan="4">${item.amount}</td> </tr> </#list><!-- end items --></table> <hr style="width: 100%; color: #D3D3D3; background-color: #D3D3D3; height: 1px;" /></#if> <table style="page-break-inside: avoid; width: 100%; margin-top: 10px;"><tr> <td colspan="4">&nbsp;</td> <td align="right" style="font-weight: bold; color: #333333;">${record.subtotal@label}</td> <td align="right">${record.subtotal}</td> </tr> <tr> <td colspan="4">&nbsp;</td> <td align="right" style="font-weight: bold; color: #333333;">${record.taxtotal@label} (${record.taxrate}%)</td> <td align="right">${record.taxtotal}</td> </tr> <tr style="background-color: #E3E3E3; line-height: 200%;"> <td background-color="#FFFFFF" colspan="4">&nbsp;</td> <td align="right" style="font-weight: bold; color: #333333;">${record.total@label}</td> <td align="right">${record.total}</td> </tr></table>
s
@Pete Kastner just a simple table.. no design yet just matter of colpans. The main reason I went with putting everything in a table is that I need the rightmost column to be one color
this is the expected
and this is the actual, it prints just fine but I have 3 lines on the inv and it prints the items individually per page
message has been deleted
in my code, it’s all just tr and tds no theads or th since I am not gonna use headers that much
p
start with the stock invoice and edit it.
s
yes I actually did that, i removed all other tables and just added the fields one by one and adding columns and rows to the original table
it kinda looks like this
initially thought that the reason it is printing individually is that this layout is broken
but I tried to redo from standard again, then added the rows and column but no fields yet and the print still produced multiple pages per line item