Load data from Angular service

Stimulsoft Reports.JS discussion
Post Reply
mrapi
Posts: 277
Joined: Sat Dec 20, 2008 1:08 am

Load data from Angular service

Post by mrapi »

Hi.
I'm trying to get data from angular service to my report
report data source is named 'ds' of type Business Objects
the code I use:

Code: Select all

....
 const report = new Stimulsoft.Report.StiReport();
report.loadFile('reports/Report.mrt');
this.viewer.renderHtml('viewerCont');

this.myService.get('/api/mydata').subscribe(t => {
     report.regData('ds', null, t);
      this.viewer.report = report;
    });
but in console I can see the error:

Parser error: The name 'ds' does not exist in the current context
thanks
Attachments
Report.zip
(1.61 KiB) Downloaded 212 times
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Load data from Angular service

Post by Lech Kulikowski »

Hello,

Please try to add synchronize method:
report.dictionary.synchronize();

Thank you.
mrapi
Posts: 277
Joined: Sat Dec 20, 2008 1:08 am

Re: Load data from Angular service

Post by mrapi »

Hi.I've updated the 2018.2.3,then publish the report to Angular 5 from Stimulsoft Designer.WinForms ,now in console got a new error

Code: Select all

Cannot read property 'createNew' of undefined


can you provide on your samples (https://github.com/stimulsoft/Samples-JS) a working one with data loaded from external api?
thanks
mrapi
Posts: 277
Joined: Sat Dec 20, 2008 1:08 am

Re: Load data from Angular service

Post by mrapi »

Hi.I've recreate the datasource of type DataSet/Data Tables and now it works.thanks
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Load data from Angular service

Post by Lech Kulikowski »

Hello,

Thank you for the additional information.
Post Reply