Page 1 of 1

Load data from Angular service

Posted: Mon Jul 30, 2018 10:55 am
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

Re: Load data from Angular service

Posted: Wed Aug 01, 2018 6:29 am
by Lech Kulikowski
Hello,

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

Thank you.

Re: Load data from Angular service

Posted: Wed Aug 01, 2018 7:25 am
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

Re: Load data from Angular service

Posted: Fri Aug 03, 2018 2:55 pm
by mrapi
Hi.I've recreate the datasource of type DataSet/Data Tables and now it works.thanks

Re: Load data from Angular service

Posted: Sun Aug 05, 2018 10:05 am
by Lech Kulikowski
Hello,

Thank you for the additional information.