Deserialization error when using business objects

Stimulsoft Reports.JAVA discussion
Post Reply
Lezenn
Posts: 12
Joined: Thu Jul 07, 2022 12:42 pm

Deserialization error when using business objects

Post by Lezenn »

Hi,

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
Here is my library version

Code: Select all

<dependency>
        <groupId>com.stimulsoft</groupId>
        <artifactId>stimulsoft-reports-libs</artifactId>
        <version>2022.3.2</version>
</dependency>
And here is the code loading my template

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;
    }
It seems to crash on the StiSerializeManager.deserializeReport() instruction.
Any idea ? :roll:
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Deserialization error when using business objects

Post by Lech Kulikowski »

Hello,

Business Objects are not supported in the Java version.

Thank you.
Lezenn
Posts: 12
Joined: Thu Jul 07, 2022 12:42 pm

Re: Deserialization error when using business objects

Post by Lezenn »

Hi,

Thanks for your reply.

I'm trying to inject datas into my template but I kinda struggle with this.
My goal is to provide data from my Java code (filling simple variables, data bands, ...).

I don't find that much documentation about that, or it is in C# and the lib's API changes.

Can you get me some examples ?
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Deserialization error when using business objects

Post by Lech Kulikowski »

Hello,

Please check the following sample:
https://www.stimulsoft.com/en/samples/r ... at-runtime

Thank you.
Post Reply