pathData - The code below used to work

Stimulsoft Reports.JS discussion
Post Reply
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

pathData - The code below used to work

Post by bobsov »

Code: Select all

console.log('Creating a new report instance');
            var report = new $window.Stimulsoft.Report.StiReport();

            console.log('Load report from url');
            report.loadFile('app/reports/Report.mrt');
          
            report.dictionary.databases.getByIndex(0).pathData =  appConfig.appUrl + 'api/reporting';
       		report.render();
            var viewer = new $window.Stimulsoft.Viewer.StiViewer(null, 'StiViewer', false);

            viewer.report = report;

            console.log('Rendering the viewer to selected element');
            viewer.renderHtml('viewer');

I upgraded to latest release js files and it shows that "report.dictionary.databases.getByIndex(0)" is undefined. I know for a fact that Report.mrt has one data source defined. If I use 2016.08.12 code, it works fine.

What would be correct way to do same thing so that it works with latest code base?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: pathData - The code below used to work

Post by Alex K. »

Hello,

We have checked the issue. It is strange behavior. Could you send us your report template for analysis.

Thank you.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: pathData - The code below used to work

Post by HighAley »

Hello.

Please, check that there is a database in your report.
Not all type of data sources use databases.
If you still get the error, please, send us your report template for analysis.

Thank you.
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: pathData - The code below used to work

Post by bobsov »

One crucial step I totally missed to say was - this only happens when I test in my build environment. In other words, when the js files are minified and uglified by grunt build. It does not happen in actual development. I have verified this and re-verified where in dev, i see there is one data source count and in build, the count is 0. Report.mrt file is in tact. Again, this is not an issue with older stimulsoft code but only with latest one.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: pathData - The code below used to work

Post by Alex K. »

Hello,

It is strange behavior. And we couldn't reproduce it on our samples.
Please send us a sample project or report on which this issue is reproduced for analysis.

Thank you.
Post Reply