Page 4 of 5
Re: Grid summary on each page
Posted: Wed Jun 12, 2013 1:29 pm
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 (50.82 KiB) Viewed 5358 times
Re: Grid summary on each page
Posted: Fri Jun 14, 2013 12:39 pm
by HighAley
Hello.
Sorry, we need a little more time to prepare an answer for you.
Thank you.
Re: Grid summary on each page
Posted: Thu Jun 27, 2013 11:08 am
by Niqu
Hello,
Any progress about this issue?
Re: Grid summary on each page
Posted: Fri Jun 28, 2013 1:10 pm
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.
Re: Grid summary on each page
Posted: Wed Jul 03, 2013 11:58 am
by Niqu
Work correctly. Thank you for help.
Re: Grid summary on each page
Posted: Wed Jul 03, 2013 12:36 pm
by Andrew
Hello,
It is pleasure to help you.
Have a nice day!
Re: Grid summary on each page
Posted: Mon Nov 25, 2013 9:32 am
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:
but there should be keys:
Thank you for help in advance.
Re: Grid summary on each page
Posted: Wed Nov 27, 2013 11:40 am
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.
Re: Grid summary on each page
Posted: Wed Nov 27, 2013 12:10 pm
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.
Re: Grid summary on each page
Posted: Fri Nov 29, 2013 2:26 pm
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
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.