Running totals and carry overs

Stimulsoft Reports.NET discussion
Post Reply
Peter Illes
Posts: 18
Joined: Tue Jun 26, 2007 8:04 am
Location: Hungary

Running totals and carry overs

Post by Peter Illes »

Dear Edward & al.,

I have seen your reply to Robert (very informative as always, thanks!) but I have some additional questions.

I have to achieve the following: I'm implementing an invoicing app, where it is possible that an invoice is multiple pages long, and at the bottom of each page (except the last) I have to implement "carry over to next page" sums of net and gross amount, and on each page (except the first) I have to show the same values at the top as "carry over from previous page". The carry overs are not only the sums on that page, but the sums from the start of the item list to that point (all pages accumulated thus far).

So indeed, I could imagine some new bands called "dataPageEndBreak"/"dataPageStartBreak", that we could configure to achieve the above... :-)

TIA,
Peter
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Running totals and carry overs

Post by Brendan »

You could use the "Print On" property of the PageHeader and PageFooter Band

Add a Page Header to the report and set the "Print On" Property to "Except First Page"
Add a Page Footer to the report and set the "Print On" Property to "Except Last Page"

and use some local variables for the running totals
Guest
Posts: 182
Joined: Tue Jun 06, 2006 8:04 am

Running totals and carry overs

Post by Guest »

Also you can use the Footer and Header with options "Print On All Pages" = "True" and for Header "Print On" = "Except First Page" and for Footer "Print On" = "Except Last Page".
For sum you can define a variable, for example "sum", and on RenderingEvent of Data Band you must write: sum+= DataSource1.FieldSum

Thank you.
Peter Illes
Posts: 18
Joined: Tue Jun 26, 2007 8:04 am
Location: Hungary

Running totals and carry overs

Post by Peter Illes »

Brendan & Pavel, that is a good idea, thanks!

There are some additional considerations, though, like I need these bands only if the items list data band is breaking on the page (if other data bands break, then I don't have to provide it). If it breaks, then I also have to repeat the data band Header on the next page.
Guest
Posts: 182
Joined: Tue Jun 06, 2006 8:04 am

Running totals and carry overs

Post by Guest »

Unfortunately, we couldn't find solution for you. We tried many variants and all of them don't bring to success.

Thank you.
grazi
Posts: 39
Joined: Fri May 23, 2008 1:55 am

Running totals and carry overs

Post by grazi »

Hello Guys,

i have a similar issue, so i tried to put the carry over in the footer. However, it seems like the footer is being rendered before the carry overs for the page are calculated, so i have the results of one page on the next page. Do you know if there's a way to set the render order of the elements?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Running totals and carry overs

Post by Edward »

If next page must contain the sum from previous page, then you need add variables in your report.

In the AfterPrintEvent of the page header this sum should be reset:

SumOnPreviousPage = 0;

This textbox on the Pageheader must have 'PrintOn' property set in 'Except First Page'.

Value for this textbox can be calculated in the BeforePrintEvent of the DataBand.

Please open the attached report in the Demo sample application from the standard installation of Stimulsoft Reports.Net.

Thank you.
Attachments
73.SumOnPageAndSubtotals.mrt
(21.17 KiB) Downloaded 418 times
grazi
Posts: 39
Joined: Fri May 23, 2008 1:55 am

Running totals and carry overs

Post by grazi »

thanks for the example and the quick reply, everything seems to work so far
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Running totals and carry overs

Post by Edward »

Please let us know if any help is required.

Thank you.
Post Reply