Help - Cannot read property 'Localization'

Stimulsoft Reports.JS discussion
Post Reply
Doghousedev
Posts: 7
Joined: Thu Oct 11, 2018 10:34 am

Help - Cannot read property 'Localization'

Post by Doghousedev »

I am trying to launch the viewer from a node.js service running on http:/localhost:3000/Viewer. I cannot find what I am doing wrong or if there is a missing component or a bug!

The route to /Viewer shows the response message in the browser window.
The 'stimulsoft.viewer.js' script is in the same directory as myApps which is running app.js (the server application on port 3000).

Other areas of the code are working correctly to render the report to HTMl (although 'stimulsoft.report.js' installed as an npm module).

My code is this:

Code: Select all

 
 app.get('/Viewer', function (req, res) {
  var n = Date.now();
  res.send('You have reached the Stimulsoft Viwer module: '+ n);
//this is work and shows the message in the browser window

  var StimulsoftViewer = require('./stimulsoft.viewer.js');
// Create an instance of the viewer
  viewer = new Stimulsoft.Viewer.StiViewer(null, "StiViewer", false);
The error code is as follows:

Code: Select all

TypeError: Cannot read property 'Localization' of undefined
    at e.Viewer.e.Viewer (C:\Users\rmbaylin\myApps\stimulsoft.viewer.js:10:61)
    at Stimulsoft (C:\Users\rmbaylin\myApps\stimulsoft.viewer.js:10:14374)
    at Object.<anonymous> (C:\Users\rmbaylin\myApps\stimulsoft.viewer.js:10:14402)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
Assistance is appreciated!

Rb
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Help - Cannot read property 'Localization'

Post by Lech Kulikowski »

Hello,

Please check samples at the following link:
https://github.com/stimulsoft/Samples-JS

Thank you.
Post Reply