I have an issue when deserializing my .mrt template with the Java library when I use business objects (created with the designer).
Code: Select all
java.lang.ClassNotFoundException: Stimulsoft.Report.Dictionary.StiBusinessObjectSource
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
Code: Select all
Caused by: java.lang.RuntimeException: Unable to obtain an analog of the class 'Stimulsoft.Report.Dictionary.StiBusinessObjectSource'
at com.stimulsoft.base.serializing.utils.StiClassConverter.getJavaClass(StiClassConverter.java:81)
... 20 more
Code: Select all
<dependency>
<groupId>com.stimulsoft</groupId>
<artifactId>stimulsoft-reports-libs</artifactId>
<version>2022.3.2</version>
</dependency>
Code: Select all
public static void main(String[] args) throws StiDeserializationException, IOException, SAXException, StiException {
StiLicense.setKey(STIMULSOFT_KEY);
StiReport report = getReport();
StiExportManager.exportPdf(report, new FileOutputStream(new File("export.pdf")));
}
private static StiReport getReport() throws StiDeserializationException, IOException, SAXException {
StiReport report = StiSerializeManager.deserializeReport(
Objects.requireNonNull(Main.class.getClassLoader().getResourceAsStream("MyTemplate.mrt"))
);
report.setCalculationMode(StiCalculationMode.Interpretation);
report.Render(false);
return report;
}
Any idea ?