Page 1 of 1

Binding Data to a Report With Json Object

Posted: Wed Mar 30, 2016 2:07 pm
by felipemoreira
Hi.

I have following code:

Code: Select all

    //my js object
    var object = {
        test: "yay"
    }
   
    //my json object
    var test = JSON.stringify(object);
   
    //Dataset created
    var dataSet = new Stimulsoft.System.Data.DataSet("teste");
    dataSet.readJson(test)

    var report = new Stimulsoft.Report.StiReport();
    report.loadFile("js/report_teste.mrt");
    report.regData(dataSet.dataSetName, "", dataSet);

    report.dictionary.connect(false);
    report.dictionary.synchronize();

    var viewer = new Stimulsoft.Viewer.StiViewer();
    viewer.report = report;
The code works, show my report file correctly, however without any data. Was to show my json object in report, was not it?
My report file has only one Report Title Band and a text component, with a fixed label.

What i need to do to show my json object(or json array whatever) on my report ? What i´m doing wrong ?

Thank you.

Re: Binding Data to a Report With Json Object

Posted: Thu Mar 31, 2016 6:09 am
by HighAley
Hello.

Please, check the name of data source.
You could try to open the report in designer. You could see there what is wrong.
If you still need our help, please, send us your report template with data.

Thank you.

Re: Binding Data to a Report With Json Object

Posted: Thu Mar 31, 2016 12:26 pm
by felipemoreira
Thanks HighAley. Your answer helped me to think more about of structure of report and the data.
I made some adjustments and it´s work now.

You can close this tread.

Re: Binding Data to a Report With Json Object

Posted: Thu Mar 31, 2016 12:39 pm
by HighAley
Hello.

We are always glad to help you.
Please, let us know if you need our help.

Thank you.