Page 1 of 1

saveDocumentToJsonString doesnt save changes from editable report

Posted: Thu Nov 22, 2018 6:54 pm
by angelcalvasp
I seem to be having a technical problem when exporting using the following method

var jsonString = report.saveDocumentToJsonString();

I have created an editable report, and when I use that method to save the document in json string It doesn’t return the report with the edited changes, is there something I’m missing that I have to do previous to calling that method?

I am using the latest version

Re: saveDocumentToJsonString doesnt save changes from editable report

Posted: Tue Nov 27, 2018 3:26 pm
by Lech Kulikowski
Hello,

We need a sample project to reproduce the issue and provide the solution for you.

Thank you.

Re: saveDocumentToJsonString doesnt save changes from editable report

Posted: Thu Dec 06, 2018 7:22 pm
by angelcalvasp
I have attached a sample project

Re: saveDocumentToJsonString doesnt save changes from editable report

Posted: Fri Dec 07, 2018 1:49 pm
by Lech Kulikowski
Hello,

You can use the following code:

Code: Select all

function updateFormDataHazardReport() {
    var report = viewer.report;
    Stimulsoft.Viewer.StiEditableFieldsHelper.applyEditableFieldsToReport(report, viewer.jsObject.reportParams.editableParameters);
    var updatedjsonString = report.saveDocumentToJsonString();
    ...
Thank you.

Re: saveDocumentToJsonString doesnt save changes from editable report

Posted: Fri Dec 07, 2018 6:43 pm
by angelcalvasp
Thank you

Re: saveDocumentToJsonString doesnt save changes from editable report

Posted: Sat Dec 08, 2018 4:07 am
by Andrew
You are welcome!

Re: saveDocumentToJsonString doesnt save changes from editable report

Posted: Mon Dec 10, 2018 3:54 pm
by angelcalvasp
Hello, is there a method so the changes are applied to the datasource so I could read its changed values from there?

viewer.jsObject.reportParams.editableParameters <= this doesnt help me for my new venture since I don't know which field actually changed

Re: saveDocumentToJsonString doesnt save changes from editable report

Posted: Tue Dec 11, 2018 8:02 pm
by Lech Kulikowski
Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.

Re: saveDocumentToJsonString doesnt save changes from editable report

Posted: Fri Dec 14, 2018 5:36 pm
by angelcalvasp
So after I used this method Stimulsoft.Viewer.StiEditableFieldsHelper.applyEditableFieldsToReport(report, viewer.jsObject.reportParams.editableParameters);
I thought I could read the updated values from the DataSource, but they still have the old values
What method do I use, so that the datasource values reflect what has been modified

Re: saveDocumentToJsonString doesnt save changes from editable report

Posted: Sun Dec 16, 2018 8:57 am
by Lech Kulikowski
Hello,

Data source does not change, the only value in the editable field, in the Text component.

Thank you.