Errors were encountered when compiling report expressions class file: 1. The method dataset(String) is undefined for the type String

Hello,

I am using Cuba 6.10.20 and reports add-on to create a Jasper report.
I got this error
“com.haulmont.reports.exception.ReportingException: Error formatting jasper report: Errors were encountered when compiling report expressions class file: 1. The method dataset(String) is undefined for the type String”
and the code line is similar to the following

"<dataSourceExpression><![CDATA[$P{REPORTING}.dataset("A01_Band")]]></dataSourceExpression>"

The same error is generated by running the example in the Cuba Report guide, BookAvailability.jrxml.

"<datasetRun subDataset="Data">
                    <dataSourceExpression><![CDATA[$P{REPORTING}.dataset("Data")]]></dataSourceExpression>"

where Data is defined as

<subDataset name="Data">
        <field name="literature_type_name" class="java.lang.String"/>
        <field name="books_instances_amount" class="java.lang.Long"/>
        <field name="reference_books_instances_amount" class="java.lang.Long"/>
    </subDataset>

What’s the problem? Which kind of param does the “dataset” function accept?

Thanks

3 Likes

I am having the same problem for the past few days

Need some help
Thank you
MB

Did you find any solution? I have the same problem trying to run the example.

Hi guys,

I’ve just downloaded the sample mentioned in the documentation, upgraded it to the latest CUBA 7.2.20 and followed the steps from the manual. Everything worked fine.

Hi Maxim,

I am using Cuba 6.10.20 as already specified and I got the error reported above.
The example is also in the manual of Cuba 6.10.20 (Manual 6.10) so it should work.
Could you try with Cuba 6.10.20?

Thanks a lot,
Nicole

Hi Maxim,

do you have any idea of the problem?

Thanks,
Nicole

Hi Nicole,

I’ve created an issue for this: Report with Jasper template doesn't work · Issue #303 · cuba-platform/reports · GitHub

We’ll take a look.

Hi everyone,

Tryed sample project on CUBA 6.10.20. Followed the steps from the manual - it works fine.

Can you provide us some demo project with this issue?