Home
Analytics
Need to show/hide data from page in footer
Troy
I have been struggling with this for a while and just can't quite get it right. What I am trying to do is replicate a standard invoice (always printing to PDF). It's best to think of it like pre-printed sheets and I need to place data in the right area(s) on the page. I need the company information, customer information, date, invoice number on top of every page. This is easy enough with repeating headers. I also need some standard text on the bottom of every page. This is also easy using the Master Page footer. Additionally I need a "terms and conditions" page at the end. I am using a grid with a hard page break and a dedicated Master Page for this.
My problem is that when the invoice has many lines they print all the way to the bottom before the page break (or break in the middle of the totals). I need to leave the space/area where the subtotal, taxes, and total are blank on every page except after the last item where I need the totals to be calculated and displayed. Basically, the bottom 3" or so of every page needs to be blank except the one containing the last invoice line.
I see the setting to not display the footer on the last page which would suffice if I put the totals in the footer of the table but this doesn't work for me since I always have one page at the end of each invoice (with it's own Master Page) and both "totals" blocks show up. This report may need to print several invoices at one time as well so the Master Page footer would only hide on the last one. I need to either print the totals in the Master Page footer on the page with the last invoice line OR print the table footer (with aggregate totals) while hiding the Master Page footer. If I could repeat table footers on every page (just like the headers) this would be much simpler but that doesn't sound possible from what I've read.
I have tried setting a global variable to hold the totals but the first Master Page seems to be created before I have access to the data. This almost works on multi-page invoices but it displays the totals on every page after the first one and not just the last one. When the report contains multiple invoices I get the totals for the last invoice on every page except the first one. I have tried setting the visibility of grids in the Master Page footer based on the row position but have the same problem. I believe this is because the Master Page is rendered before the report items but after the datasets? Counting dataset rows and using a group to force a page break is not an option since this report design will be used by many places with different settings and I can't guarantee that each will break consistently. Plus, I still have the problem of printing on the bottom of the page on a Master Page that reserves that area.
What would be ideal is to know the last page of data beforehand so the Master Page could be switched on the page break (or so I could set the global variables to some value so they'll display in the footer). However, I can't figure out a way to know I'm at the end until the Master Page for that page has already been rendered. I'm assuming that since BIRT knows the total number of pages (at some point) to display the "page n of m" value that I might be able to access this? Is it possible to modify Master Page footer items based on the data that is displayed on that page? Can I somehow say "change the data/text in the footer of page 5 to the value of the aggregate subtotal on the same page"? If I could get it to work on one invoice at a time I may have a workaround printing doing multiple invoices.
Using BIRT 2.14 through Eclipse and upgrading isn't an option for at least the next several months. Any ideas?
Thanks!
Troy
Find more posts tagged with
Comments
mwilliams
Hi Troy,
You've probably already found a solution to this, but one could have been to create an interval page break within your invoice group you already have. You could then limit the amount of lines displayed per page of the group and would have a footer for this group on the end of each page.