Get PageNumber after ResetPageNumber at RunTime
Posted: Fri Dec 16, 2016 11:41 am
Hello,
I have to read the current PageNumber respectively the TotalPageCount of one Report of many.
I set the ResetPageNumber on a StiGroupHeaderBand.
When I take SinglePass it works wrong, but on the printed pages it is correct.
PageNofM, PageNumber, PageTotalCount all these SystemVariables are pinted correct on the renderd report in the view.
For Example, it is printed PageTotalCount and PageNumber 1, 1, 4 on the view with NumberOfPass = SinglePass correct.
But with the code you see below, the Report.CompiledReport.PageNumber and TotalPageCount after print GroupFooter
I get 1, 1, 6, when I use SinglePass. When I use DoublePass it works correct. But I have to render up to 35.000 pages. So
I can't render the Report a second time.
How do you print the correct pagenumber with SinglePass?
Tank you
I have to read the current PageNumber respectively the TotalPageCount of one Report of many.
I set the ResetPageNumber on a StiGroupHeaderBand.
When I take SinglePass it works wrong, but on the printed pages it is correct.
PageNofM, PageNumber, PageTotalCount all these SystemVariables are pinted correct on the renderd report in the view.
For Example, it is printed PageTotalCount and PageNumber 1, 1, 4 on the view with NumberOfPass = SinglePass correct.
But with the code you see below, the Report.CompiledReport.PageNumber and TotalPageCount after print GroupFooter
I get 1, 1, 6, when I use SinglePass. When I use DoublePass it works correct. But I have to render up to 35.000 pages. So
I can't render the Report a second time.
Code: Select all
...
if (Report.CompiledReport.NumberOfPass == StiNumberOfPass.SinglePass) {
//Report.CompiledReport.NumberOfPass = StiNumberOfPass.DoublePass;
}
StiGroupFooterBand stiGroupFooterZahlschein = (StiGroupFooterBand) Report.CompiledReport.GetComponents()["GroupFooterZahlschein"];
if (stiGroupFooterZahlschein != null) {
stiGroupFooterZahlschein.AfterPrint += new EventHandler(OnGroupFooterZahlschein_AfterPrint);
}
StiGroupHeaderBand stiGroupHeaderZahlschein = (StiGroupHeaderBand) Report.CompiledReport.GetComponents()["GroupHeaderZahlschein"];
if (stiGroupHeaderZahlschein != null) {
stiGroupHeaderZahlschein.ResetPageNumber = true;
}
...
private void OnGroupFooterZahlschein_AfterPrint(object sender, EventArgs e) {
//if (Report.CompiledReport.IsSecondPass) {
int pNr = Report.CompiledReport.PageNumber;
int pNrTotal = Report.CompiledReport.TotalPageCount;
//}
}
Tank you