jasper-reports

jrxml uuid attribute not allowed with JasperReports 6.21.0


I'm trying to create pdfs with Khmer language. I have the following maven dependency in my project.

As per this answer https://stackoverflow.com/a/54087030/552423 the jrxml https://github.com/TIBCOSoftware/jasperreports/blob/master/demo/samples/unicode/reports/UnicodeReport.jrxml is supposed to work, as I use jasperreports 6.21 version.

        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>6.21.0</version>
        </dependency>
        
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports-fonts</artifactId>
            <version>6.21.0</version>
        </dependency>

But I get the below exception

org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'uuid' is not allowed to appear in element 'jasperReport'.

I tried by removing the uuid attribute values, but got same error for other attributes like vTextAlign, 'height' in title elements. I think valid schema should be added in the below jasperReport element.

<jasperReport name="UnicodeReport" language="java" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" uuid="9df06543-a919-4db2-9dcd-ed4c8a66dec7">

Note: Possible duplicate question cvc-complex-type.3.2.2 attribute 'uuid' is not allowed to appear in element 'jasperreport' has answers suggesting to remove uuid, while this question is answered to keep uuid, which is the intention of this question.


Solution

  • The UnicodeReport.jrxml file on the master branch works with JasperReports 7.x.

    If you want the report that works with JasperReports 6.21.0 you can see the file as present on the 6.21.0 tag: https://github.com/TIBCOSoftware/jasperreports/blob/6.21.0/jasperreports/demo/samples/unicode/reports/UnicodeReport.jrxml