Jasper Report : Document root element “jasperReport”, must match DOCTYPE root “null”

后端 未结 2 610
清酒与你
清酒与你 2020-12-07 05:24

I have designed jasper report using iReport version (4.7.1). Through iReport it works fine. When I called from java servlet, I get an error:

Err         


        
相关标签:
2条回答
  • 2020-12-07 05:51

    Assuming that the jrxml file has been added to your jar file, you should load it like this:

    InputStream is = ReportServlet.class.getResourceAsStream(themeDesignName);
    jasperDesign = JRXmlLoader.load(is);
    
    0 讨论(0)
  • 2020-12-07 06:14

    Earlier versions of JasperReport use DOCTYPE. Newer versions use XMLNS. When you opened your .JRXML, the iReport saved it using XMLNS and removed previous DOCTYPE tag, at the beginning of document. Update your Jasper JARS version, or save your JRXML as older version.

    0 讨论(0)
提交回复
热议问题