I use a GroupFooterBand to display a cumulative page sum (subtotal) for a table with order positions. I use a custom summary funtion to display this cumulative page sum.
Below the table with the order positions, other tables with data like service cost, VAT and discounts follow. For this reason, I would like to hide the GroupFooterBand with the subtotal on the last page of the order. The same applies if the table with order positions is short and everything fits on a single page.
However, I can't access the page information in the BeforePrint event of the band. When I set e.cancel true in the PrintOnPage event of the table or table cell, the line with the GroupFooterSum is not printed but a blank line appers instead.
How can I hide the band at the end of the table?
I believe that you can utilize the DataBrowser.HasLastPosition property within the GroupFooter.BeforePrint event. For reference, see a sample code in the attachment. Hope this helps.
I should have mentioned that I looked already at the dataBrowser but haven't been able to make it work to my requirements.
Please have a look at the attached sample project. Please note that this shows two orders (with only one page each) and the summary is hidden only on the 2nd page.
This is obviously a simplified example but it should show the basic desired layout.
Thank you for your support.
Thank you for the additional clarification. I believe that you can use the CurrentRowIndex and RowCount properties of your DetailReportBand to define whether the group footer should be shown. Attached is an updated sample illustrating this approach. Let me know whether it meets your requirements.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.