Integrating Json into report as string instead of file
Posted: Tue Dec 20, 2016 7:54 am
I have a running example of integrating a Json as a StiJsonDatabase with the following code.
Now I have the problem, that I want to integrate the json as a string into the report instead of a file, which I have been able to get running with the following code:
This does work, but I get a lot of warnings (one for each table in the data) that read 'Element named 'TableXyz1' missing.
Is there a better way to integrate a json-String as data?
Thanks a lot in advance
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();
Code: Select all
StiReport report = StiSerializeManager.deserializeReport(new File("report/Selection.mrt"));
DataSet ds = StiJsonToDataSetConverter.detDataTable(jsonString);
report.dictionary.setCacheDataSet(ds);
report.setJsonReport(true);
report.render();
Is there a better way to integrate a json-String as data?
Thanks a lot in advance