Cannot read property 'pageNumbers' of null

Stimulsoft Reports.JS discussion
Post Reply
chandi
Posts: 4
Joined: Thu Apr 01, 2021 4:33 pm

Cannot read property 'pageNumbers' of null

Post by chandi » Wed Apr 07, 2021 7:33 am

Hi,

I am trying to load existing saved report from JS through MVCWebAPI project.
I need to load report design and view in same page.

This is my .cshtml page

<script type="text/javascript">
var report = new Stimulsoft.Report.StiReport();
report.loadFile("/Reports/SimpleList.mrt");
var dataSet = new Stimulsoft.System.Data.DataSet("Demo");
// Load JSON data file from specified URL to the DataSet object
dataSet.readJsonFile("/Reports/Demo.json");
// Remove all connections from the report template
report.dictionary.databases.clear();
// Register DataSet object
report.regData("Demo", "Demo", dataSet);

report.renderAsync();

var designer = new Stimulsoft.Designer.StiDesigner(null, "StiDesigner", false);
designer.report = report;
designer.renderHtml("content");

var viewer = new Stimulsoft.Viewer.StiViewer(null, "StiViewer", false);
viewer.report = report;
viewer.renderHtml("viewer");
</script>

<div>
<div id="viewer"></div>
<div id="content"></div>
</div>

when loading it gives "Cannot read property 'pageNumbers' of null" error.

Note : This happens only both viewer and designer includes in one page.

Thank You
Lech Kulikowski
Posts: 3463
Joined: Tue Mar 20, 2018 5:34 am

Re: Cannot read property 'pageNumbers' of null

Post by Lech Kulikowski » Wed Apr 07, 2021 9:41 am

Hello,

Please check the last release build. If the issue still present, please send us a sample project that reproduces the issue for analysis on support@stimulsoft.com

Thank you.
Post Reply