Hello guys,
I am trying to use Pentaho reporting functionality in my application. I have a MariaDB database from which I want to get data.
I tried to mix up Sample1.java (which uses premade .prpt template) and Sample2.java (which uses database connection) but unsuccessfully.
I made a template in Pentaho Report Designer and exported .prpt, but when I try use it everytime I get
Exception in thread "main" java.lang.NullPointerException: Key data must not be null. at org.pentaho.reporting.libraries.resourceloader.DefaultResourceManagerBackend.createKey(DefaultResourceManagerBackend.java:50)
at org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey(ResourceManager.java:151)
at org.pentaho.reporting.libraries.resourceloader.ResourceManager.createKey(ResourceManager.java:137)
at org.pentaho.reporting.libraries.resourceloader.ResourceManager.createDirectly(ResourceManager.java:213)
at org.pentaho.reporting.engine.classic.samples.Sample1.getReportDefinition(Sample1.java:66)
at org.pentaho.reporting.engine.classic.samples.AbstractReportGenerator.generateReport(AbstractReportGenerator.java:160)
at org.pentaho.reporting.engine.classic.samples.AbstractReportGenerator.generateReport(AbstractReportGenerator.java:128)
at org.pentaho.reporting.engine.classic.samples.Sample1.main(Sample1.java:121)
Do you maybe have some advice? How getReportDefinition() method should look like? And maybe I am not generating .prpt file properly from Report Designer?
Using Sample2.java works fine, but the output file has no template so it looks terrible. Is there any other way to customize it than generating .prpt in Report Designer?