SumRunning in DataBand: reset after change group

Stimulsoft Reports.NET discussion
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: SumRunning in DataBand: reset after change group

Post by HighAley »

Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Re: SumRunning in DataBand: reset after change group

Post by Fabio Pagano »

Good morning.

I've noticed that if the same group is printed on two pages, the RunningTotal is reset at each page (I understand why, because in the event "after print" of the grouping i've put the reset of the RunningTotal).

Design: in the "AfterPrint" event ("Dopo la stampa" in Italian) I've put the RunningTotal reset (for two fields, one for the total on each row and one for the total of the group):

Image

The result is that when the group goes on more than one page, the group header is printed and the RunningTotal is reset:

Image

Do you have any suggestion?

Thank you.
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Re: SumRunning in DataBand: reset after change group

Post by Fabio Pagano »

At the moment I've solved creating a new group (above the existing one) that prints only on first page and I've put the reset code in this new group, as suggested in this thread:

http://forum.stimulsoft.com/viewtopic.php?f=8&t=5600

Don't know if there are different solutions.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: SumRunning in DataBand: reset after change group

Post by HighAley »

Hello.

As we can see the Print on All Pages property of the Group Header is set to true. So the After Print event fires on the new page.
Other solution is to reset values on the After Print event of the Group Footer Band.

Thank you.
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Re: SumRunning in DataBand: reset after change group

Post by Fabio Pagano »

I've followed your suggestion and I've put the reset code (reset for the sumrunning field in the databand and for the sumrunning field in the group footer) in the GroupFooter AfterPrint event:

Image

But the SumRunning field that I use in the GroupFooter as a total, is now printed zero:

Image

Image

I've solved changing it in a normal sum field:

Image

and eliminating its reset in the after print event of the footerband, leaving only the reset for the sumrunning field in the databand:

Image

Now it works as I wanted, with the sumrunning reset (of the sumrunning field in the databand) at change grouping and not at changing page or no reset at all (that was the problem that started this thread).

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: SumRunning in DataBand: reset after change group

Post by HighAley »

Hello.

Great! We are very glad to work with such customers.

Thank you for using our product.
Post Reply