I've tried to produce a simple report using the latest Stimulsoft for Java (Trial) and I've ran into a multiple problems.
The example with XML works fine, but the problem is when I attempt to create my own report in code.
I want to pull objects from REST API and show its response in report. But I'm unable to show nothing in the document.
This is simple example I've tried:
Code: Select all
StiReport report = new StiReport();
StiPage stiPage = new StiPage(report);
report.getPages().add(stiPage);
report.setDictionary(new StiDictionary(report));
StiDataTableSource stiDataTableSource = new StiDataTableSource();
DataTable table = new DataTable();
StiDataColumnsCollection col = new StiDataColumnsCollection(stiDataTableSource);
col.add(new StiDataColumn("user.id", "user.id", StiSystemType.getSystemType("System.String")));
table.setColumns(col);
DataRow dataRow = table.createNewRow();
dataRow.addCell("user.id", "TEST");
stiDataTableSource.setDataTable(table);
report.getDictionary().getDataSources().add(stiDataTableSource);
report.render();
java.lang.NullPointerException com.stimulsoft.report.dictionary.dataSources.StiDataSource.setDataTable(StiDataSource.java:1502)
does anyone know where the problem could be? Or is there a way to render report without using Database Data Source? I would like to somehow render List<Entity>. or is there a tutorial for that?