Example of rendering a report with Java and Json?
Posted: Thu Dec 01, 2016 1:53 pm
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
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
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();
Thanks a lot in advance