Getting the total number of pages

Stimulsoft Reports.JS discussion
Post Reply
Kline
Posts: 35
Joined: Thu Nov 29, 2018 8:22 am

Getting the total number of pages

Post 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
Lech Kulikowski
Posts: 7291
Joined: Tue Mar 20, 2018 5:34 am

Re: Getting the total number of pages

Post by Lech Kulikowski »

Hello,

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

Thank you.
Kline
Posts: 35
Joined: Thu Nov 29, 2018 8:22 am

Re: Getting the total number of pages

Post 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
Kline
Posts: 35
Joined: Thu Nov 29, 2018 8:22 am

Re: Getting the total number of pages

Post by Kline »

Obviously the object "report" in the example is a valid report, it displays 3 pages
Lech Kulikowski
Posts: 7291
Joined: Tue Mar 20, 2018 5:34 am

Re: Getting the total number of pages

Post by Lech Kulikowski »

Hello,

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

Thank you.
Post Reply