Fail load js files in single page application

Stimulsoft Reports.JS discussion
Post Reply
tuxwars
Posts: 5
Joined: Thu Jun 29, 2017 8:23 pm

Fail load js files in single page application

Post by tuxwars »

I have problems trying to integrate the js files in my application, I get the following message:

Code: Select all

   Uncaught TypeError: Cannot read property 'Localization' of undefined
    at e.Viewer.e.Viewer (stimulsoft.viewer.js:9)
    at Stimulsoft (stimulsoft.viewer.js:9)
    at stimulsoft.viewer.js:9
The files I load through :

Code: Select all

$.cachedScript(FilesURL + "/Assets/js/stimulsoft/" + "stimulsoft.reports.js");
$.cachedScript(FilesURL+ "/Assets/js/stimulsoft/" + "stimulsoft.viewer.js");
And when I run the report the page throws the following message:

VM2687:12 Uncaught TypeError: Stimulsoft.Viewer.StiViewer is not a constructor

The code in view is:

Code: Select all

             var report = new Stimulsoft.Report.StiReport();
            report.loadFile(ServerURL + "/DownloadFile");

            var viewer = new Stimulsoft.Viewer.StiViewer(null, "StiViewer", false);
            viewer.report = report;
            viewer.renderHtml("viewerContent");  
What am I doing wrong?
tuxwars
Posts: 5
Joined: Thu Jun 29, 2017 8:23 pm

Re: Fail load js files in single page application

Post by tuxwars »

I already found the problem, the js stimulsoft does not work with moments js
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Fail load js files in single page application

Post by Alex K. »

Hello,

Please let us know if you need any additional help.

Thank you.
harryf75
Posts: 20
Joined: Sun Jun 11, 2017 9:59 pm

Re: Fail load js files in single page application

Post by harryf75 »

tuxwars wrote:I already found the problem, the js stimulsoft does not work with moments js
Works för me...
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Re: Fail load js files in single page application

Post by Andrew »

Great! Thank you!
Post Reply