Tricky part is how do I get the number of pages [page count] after
the report got rendered. I tried to get the number of pages before
rendering the report but was unsuccessful by using the adapter class and
getNumberOfPages() method.
Finally, I found a solution. On Controller classes there is a method by name “reportViewerRefreshComplete” which can be overridden. This method gets triggered once the data has been rendered on to report viewer.
Override the “reportViewerRefreshComplete” method on any controller class and add the below code. This will help to get the count of printed physical pages on to report.

Finally, I found a solution. On Controller classes there is a method by name “reportViewerRefreshComplete” which can be overridden. This method gets triggered once the data has been rendered on to report viewer.
Override the “reportViewerRefreshComplete” method on any controller class and add the below code. This will help to get the count of printed physical pages on to report.
public void reportViewerRefreshComplete(SRSReportExecutionInfo _executionInfo)
{
int page;
super(_executionInfo);
page = this.getReportContract().parmReportExecutionInfo().parmPrintedPhysicalPages();
info("Total number of pages:" + int2str(page));
}
Below is the infolog with the counter of pages, after the report data got rendered on to report viewer.

No comments:
Post a Comment