Page 1 of 1

Example of rendering a report with Java and Json?

Posted: Thu Dec 01, 2016 1:53 pm
by mke_imp
I'm a bit lost on how to correctly initialize a report file with a json-datasource in java, and then getting it to render correctly.

I have a mrt-File and a json-File, those both work together fine, wenn looking at them in the designer.
But trying to do something like the following ends in a NullPointerException

Code: Select all

        
        StiReport report = StiSerializeManager.deserializeReport(new File("report/Selection.mrt"));
        StiJsonDatabase jsonDb = new StiJsonDatabase("Data", "report/data.json");
        StiDatabaseCollection coll = new StiDatabaseCollection();
        coll.add(jsonDb);
        report.dictionary.setDatabases(coll);
        report.setJsonReport(true);
        report.render();
Is there somewhere where I could find an example on how to render a report with a json-File through the Java-Libraries (2016.2)?

Thanks a lot in advance

Re: Example of rendering a report with Java and Json?

Posted: Thu Dec 01, 2016 3:08 pm
by mke_imp
could solve the problem myself, the problem was in the way the json was built

Re: Example of rendering a report with Java and Json?

Posted: Thu Dec 01, 2016 9:12 pm
by Alex K.
Hello

Ok.
Please let us know if you need any additional help.

Thank you.

Re: Example of rendering a report with Java and Json?

Posted: Fri Dec 02, 2016 8:17 am
by mke_imp
Unfortunately I really do have another problem ;) :

The json for the data now is built up as suggested in another thread with every object as an array, so that it can turned into a table. Now I have a groupheader, that takes its data from a table with relationships, but where I want to put as well some of the same data into for every grouped entry.

This once again seems to work fine in the designer (.NET 2016.2), but when rendering the report through java (see code in first post) I get a parse-error for a null-value.

I have some demo data attached, the problem lies within the PartialOffers.

I have already tried calling those values with PartialOffers.DataTable.Rows[0]["columnName"], but then the report does throw errors.

Re: Example of rendering a report with Java and Json?

Posted: Mon Dec 05, 2016 8:26 pm
by Alex K.
Hello,

We need some additional time to check the issue.
We will let you know about the result in this topic.

Thank you.

Re: Example of rendering a report with Java and Json?

Posted: Thu Dec 08, 2016 11:56 am
by Vadim
Hello.
The bug with PartialOffers will be fixed since 2016.3.1 pre-release build

Re: Example of rendering a report with Java and Json?

Posted: Fri Dec 09, 2016 8:18 am
by mke_imp
Thanks a lot for looking into it.
Do you have a timeframe when that pre-release build will be available?

Re: Example of rendering a report with Java and Json?

Posted: Sat Dec 10, 2016 4:24 am
by Vadim
Hello.
Now you can use 2016.3 release.

Re: Example of rendering a report with Java and Json?

Posted: Tue Dec 13, 2016 9:11 am
by mke_imp
Thank you! Works great :-)

Re: Example of rendering a report with Java and Json?

Posted: Wed Dec 14, 2016 9:45 am
by HighAley
Hello.

We are always glad to help you.
Let us know if you need our help.

Thank you.