简体   繁体   中英

org.xml.sax.SAXParseException: Document root element “jasperReport”, must match DOCTYPE root “null”

I am trying t develop an application which gives out the report using Jasper Reports+iReport, all the thing went fine until i got this error on running the program. I am not much into xml so please consider me a noob while helping, so Please help me out, here is my report.jrxml file

<?xml version="1.0" encoding="UTF-8"?>
< jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" 
       name="report1" 
       language="groovy" 
       pageWidth="595" 
       pageHeight="842" 
       columnWidth="555" 
       leftMargin="20" 
       rightMargin="20" 
       topMargin="20" 
       bottomMargin="20">
    .................................
    ..............
    ............
</jasperReport>

Two things:

  1. Make sure that the document is well-formed. In the start tag of the root element, remove the space after the left angle bracket so that it reads <jasperReport .

  2. See http://coffeecokeandcode.blogspot.com/2008/11/jasper-reports-and-legacy-formats.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM