Page 1 of 1

Getting the total number of pages

Posted: Wed Mar 25, 2020 3:01 pm
by Kline
Hi,
in the dictionary of the report there are the system variables TotalPageCount and TotalPageCountThrough, there is a way to retrieve this varables in my javascript code after I called the render function?

I tried to access the report.totalPageCount and report.totalPageCount properties but they are always 0.

Thank you

Re: Getting the total number of pages

Posted: Thu Mar 26, 2020 9:34 pm
by Lech Kulikowski
Hello,

Please try to check the report.renderedPages.count property.

Thank you.

Re: Getting the total number of pages

Posted: Fri Mar 27, 2020 3:37 pm
by Kline
Hi,
I tried with the following code but the value of the report.renderedPages.count property is always 0

Code: Select all

	var options = new Stimulsoft.Viewer.StiViewerOptions();
        options.appearance.fullScreenMode = true; 
        options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Div;
        options.appearance.chartRenderType = Stimulsoft.Viewer.StiChartRenderType.Vector;			
        var viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);		
        viewer.report = report;
        viewer.renderHtml("viewerContent");                            
                            
        console.log("COUNT PAGES ", report.renderedPages.count);
Thanks

Re: Getting the total number of pages

Posted: Fri Mar 27, 2020 3:41 pm
by Kline
Obviously the object "report" in the example is a valid report, it displays 3 pages

Re: Getting the total number of pages

Posted: Mon Mar 30, 2020 12:44 pm
by Lech Kulikowski
Hello,

You should call the render() method fo the report.

Thank you.