Page 1 of 1

load a report from a saved json string

Posted: Tue Sep 04, 2018 5:26 am
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

Re: load a report from a saved json string

Posted: Wed Sep 05, 2018 7:34 am
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.

Re: load a report from a saved json string

Posted: Sun Sep 09, 2018 7:34 am
by Abed Hamodi
hello
it's work fine
thank you

Re: load a report from a saved json string

Posted: Sun Sep 09, 2018 7:36 am
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

Re: load a report from a saved json string

Posted: Mon Sep 10, 2018 1:06 pm
by Lech Kulikowski
Hello,

Could you explain your issue in more details?

Thank you.