Hi everyone, I’m having trouble with a Google Docs template for an invoice PDF generated by a bot. The document has a header with customer and order details. The problem is with the table of items, which grows with the number of products. This causes the invoice total to move down, instead of staying in the bottom-right corner of the last page. I’ve tried putting <<[TOTAL_FACTURA]>> in the footer, but it didn’t work. Is there a way to keep the total fixed in the bottom-right corner, regardless of the number of items? I have attached the template I’m using.
Please try below.
Please create a table in the document with 2 rows and single column. In the image below , I have purposely created the table with red border, just to display the concept. After testing make the border white in your case.
Now please include or insert the upper part of your template in the upper cell of the red border table.
And include the Total FACTURA with <<[Total_Factura]>> in the lower cell of the red border table.
In my example the expression with the loop of [Related Order Details] is in the upper cell of the red border table and the [Order Total] is in the lower cell of the table.
Now most important part. Please set the row height upper cell of the red border something like say 6 inches and the row height of the lower cell of the red border table as something like 0.75 inch. You will need to adjust the height of both the cells per your requirement. Also ensure there are no spaces in both the red border table cells except the included tables with expressions.
Now the report output will appear something like below
The below order has only one line item , still the order total appears at the bottom.
Now the below order has multiple line items but still the order total appears at the same place.
And another workaround is to add blank rows to the Child table and based on your child records qty, add those additional rows as well. They will be shown as blank lines.
Ok. I will try that. What would happen if an order has so many items, that it would need to fill a second page? The Order Total will show in both pages? The table headers will show in second page?
No, if there are more items than can be accommodated in one page , the total will not move to next page with this approach.
In that case , please use Aleksi’s suggested approach.
I tried this solution and it works fine until 12 items. From 13 items or more, the main table, the one containing de secnd table, moves completely to the second page, and the first page is left alone with the information above the table. All I need is de TOTAL to stay at the bottom right corner of the page 1 or 2 if it takes 2 pages.
A master class by @SkrOYC:
That’s an overstatement but many thanks!
Well, I had mentioned that it is essentially one page solution.
Anyway, if there are going to be say 20 items, I believe it can be accommodated with a little tweak to the invoice line items table. As we can see, the Articulo values in each row has spilled into 2 lines whereas other columns have very minimal data. I would try to adjust the width (and title ) of the other columns so that the " Articulo" can be accommodated in one line. That will make more items to be accommodated in one page. The columns of Cantidad (can be renamed Qty) , P/U and SUB TOTAL can certainly have much lesser width that will allow the Articulo column to have longer width, thereby accommodating the description in one line.
However, please note that it is essentially one page solution. If with modification, your testing shows that it can accommodate say 20 items, it will not work for 21 items.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.








