load a report from a saved json string

Stimulsoft Reports.JS discussion
Post Reply
Abed Hamodi
Posts: 19
Joined: Wed May 18, 2016 9:55 am

load a report from a saved json string

Post by Abed Hamodi »

hello ,
I am trying to load a report from a saved json, I saved the report to a jason string:

Code: Select all

var json = this.designer.report.saveDocumentToJsonString();
then I used the saved json to load it to a new report:

Code: Select all

this.designer = new Stimulsoft.Designer.StiDesigner(this.options, 'StiDesigner', false);
this.designer.report = new Stimulsoft.Report.StiReport();
this.designer.report.load(json);
this.designer.renderHtml('designer');
[/code]

Can you please help?
Thanks in advance
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: load a report from a saved json string

Post by Lech Kulikowski »

Hello,

saveDocumentToJsonString() - saving rendered report (report document), not the report temaplate. You should use saveToJsonString() method
https://www.stimulsoft.com/en/documenta ... report.htm

Thank you.
Abed Hamodi
Posts: 19
Joined: Wed May 18, 2016 9:55 am

Re: load a report from a saved json string

Post by Abed Hamodi »

hello
it's work fine
thank you
Abed Hamodi
Posts: 19
Joined: Wed May 18, 2016 9:55 am

Re: load a report from a saved json string

Post by Abed Hamodi »

hello ,
how can i change type of columns in code to data or int or ..
Please see my code
var columns = this.designer.report.dataSources.items[0].columns.list;
columns.forEach(column => {

column.type= Date; // not work

});

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

Re: load a report from a saved json string

Post by Lech Kulikowski »

Hello,

Could you explain your issue in more details?

Thank you.
Post Reply