Grid summary on each page
Re: Grid summary on each page
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.
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.
Re: Grid summary on each page
Hello.
Sorry, we need a little more time to prepare an answer for you.
Thank you.
Sorry, we need a little more time to prepare an answer for you.
Thank you.
Re: Grid summary on each page
Hello,
Any progress about this issue?
Any progress about this issue?
Re: Grid summary on each page
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.
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 501 times
-
- Capture.PNG (31.23 KiB) Viewed 5311 times
Re: Grid summary on each page
Work correctly. Thank you for help.
Re: Grid summary on each page
Hello,
It is pleasure to help you.
Have a nice day!
It is pleasure to help you.
Have a nice day!
Re: Grid summary on each page
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.

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
Code: Select all
p1c1
p1c2
p1c3
p3c1
p2c2
p2c3
- Attachments
-
- Report.mrt
- (27.25 KiB) Downloaded 348 times
Re: Grid summary on each page
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.
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
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.
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
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:
Thank you.
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 = ....;
Code: Select all
int storedCurrentPrintPage = rep.CurrentPrintPage;
rep.CurrentPrintPage = rep.RenderedPages.IndexOf(page) + 1;
int realPageNumber = rep.PageNumber;
rep.CurrentPrintPage = storedCurrentPrintPage;