Grid summary on each page

Stimulsoft Reports.WPF discussion
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Grid summary on each page

Post by Niqu »

Incorrect values are in second and third column . As you can see in the project in second column should be values "2" and in third column should be values "3".
I also check it by having this function in .dll and using method from this .dll to see on debug that values are sending to method - and if i have system variable "PageNumer" it send wrong values.

This is screen for the same Data, but using this code in event:
As you can see on this screen values in column are correct (first column -> values 1, second column -> values 2, third column -> values 3), but summary is incorrect.
Report_modified4.png
Report_modified4.png (50.82 KiB) Viewed 5354 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Grid summary on each page

Post by HighAley »

Hello.

Sorry, we need a little more time to prepare an answer for you.

Thank you.
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Grid summary on each page

Post by Niqu »

Hello,

Any progress about this issue?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Grid summary on each page

Post by Alex K. »

Hello,
Sorry for the delay with response.

In this case there is the following solution:
- save the currents values in the additional temporary object (as exmple hashtable) in AfterPrint or BeforePrint event of Text component.
- and then calculate the summary values in AfterPrint event of MAIN master Databand, because your report have the several nestings of containers and correct PageNumber you can know only on parent component.
Attachments
Report_modified3.mrt
(18.03 KiB) Downloaded 502 times
Capture.PNG
Capture.PNG (31.23 KiB) Viewed 5315 times
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Grid summary on each page

Post by Niqu »

Work correctly. Thank you for help.
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Re: Grid summary on each page

Post by Andrew »

Hello,

It is pleasure to help you.

Have a nice day!
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Grid summary on each page

Post by Niqu »

Sorry, that again the same problem :(
Everything works good, but not always - if we have report, that has first one (or some) title pages and then page with summary it do not work correctly.

I add simple report to attachments, to show what do not work.
As I can see when values are added to dictionary (in event "After Print" in DataBand) value of variable "PageNumber" is wrong (in every other places it seems to be ok).

In this simple report I add additional "PageHeader" and method "Foo()", to show what keys are in dictionary. We have keys:

Code: Select all

p3c1
p3c2
p3c3
p4c1
p4c2
p4c3
but there should be keys:

Code: Select all

p1c1
p1c2
p1c3
p3c1
p2c2
p2c3
Thank you for help in advance.
Attachments
Report.mrt
(27.25 KiB) Downloaded 349 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Grid summary on each page

Post by HighAley »

Hello.

But the DataBand1 is on the 3 and 4 page. So the keys are right. Why do you think that they should be 1 and 2?

Thank you.
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Grid summary on each page

Post by Niqu »

Hm... maybe I miss understand something.

I have 2 pages: first with title and some day, second with my dataBand and summary.
Second page has property "Reset Page Number" set to true. On this page in "pageHeaderBand1" I have system variable PageNumber and it prints 1 and 2 (not 3 and 4). On this second page in subreports I have bands to show summary and this bands are printing values from dictionary (they are using method like "GetSumValuesA(int pageNo, int col)" and as parameter "pageNo" sending 1 and 2 (not 3 and 4)).
That why I think that they should be 1 and 2, not 3 and 4, becouse in everyother places where I am using system variable "PageNumber", it has value 1 and 2, not 3 and 4.

Of course I can be wrong, becouse I do not know all logic behind this, but still I think it is something wrong that in one place the same parameter has one value, and in the other place the same parameter has other value.
And if it is still correct, so maybe can give me some advice what should I do to make this raport work?


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

Re: Grid summary on each page

Post by HighAley »

Hello.

The calculating of right page numbers is doing in the end of first pass. So you get continuous numeration.

The only solution that we can suggest you is to store page instance on the First pass

Code: Select all

StiPage page = ....;
and then in the Begin render of the report on Second pass you could get the right page number with next code:

Code: Select all

            int storedCurrentPrintPage = rep.CurrentPrintPage;
            rep.CurrentPrintPage = rep.RenderedPages.IndexOf(page) + 1;
            int realPageNumber = rep.PageNumber;
            rep.CurrentPrintPage = storedCurrentPrintPage;
Thank you.
Post Reply