我有一个 JRXML 文件,当我尝试将其编译为 jasper 时,它会显示一些错误。
我的JRXML文件:
<?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="new" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="orgId" class="java.lang.String">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<parameter name="fromDate" class="java.lang.String">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<parameter name="toDate" class="java.lang.String">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[select
a.CUS_INV_DT
,a.CUS_INV_NO
,(select cus_short_name from INV_CUST_MASTER where org_id = a.ORG_ID and cus_code = a.CUS_INV_CUS_CODE) as CUST_NAME
,(select CUS_ORD_NET_VAL from INV_CUST_SO_SUMRY where ORG_ID = a.ORG_ID and cus_ord_cus_code = a.cus_inv_cus_code and cus_ord_no = a.CUS_INV_SALES_ORD_NO)as CUS_ORD_NET_VAL
,(SELECT FST_NAME FROM USER_MASTER WHERE ORG_ID = a.ORG_ID AND USER_ID = a.LAST_UPDATED_BY) as UPDATED_BY
,a.CUS_INV_STATUS
from INV_CUST_INVOICE_SUMRY a
where
a.ORG_ID = $P{orgId}
and a.CUS_INV_DT between $P{fromDate} AND $P{toDate} order by a.CUS_INV_NO]]>
</queryString>
<field name="CUS_INV_DT" class="java.sql.Timestamp"/>
<field name="CUS_INV_NO" class="java.lang.String"/>
<field name="CUST_NAME" class="java.lang.String"/>
<field name="CUS_ORD_NET_VAL" class="java.math.BigDecimal"/>
<field name="UPDATED_BY" class="java.lang.String"/>
<field name="CUS_INV_STATUS" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="29" splitType="Stretch">
<staticText>
<reportElement x="100" y="0" width="100" height="20"/>
<textElement/>
<text><![CDATA[CUS_INV_NO]]></text>
</staticText>
<staticText>
<reportElement x="0" y="0" width="100" height="20"/>
<textElement/>
<text><![CDATA[CUS_INV_DT]]></text>
</staticText>
<staticText>
<reportElement x="200" y="0" width="100" height="20"/>
<textElement/>
<text><![CDATA[CUST_NAME]]></text>
</staticText>
<staticText>
<reportElement x="300" y="0" width="129" height="20"/>
<textElement/>
<text><![CDATA[CUS_ORD_NET_VAL]]></text>
</staticText>
<staticText>
<reportElement x="429" y="0" width="100" height="20"/>
<textElement/>
<text><![CDATA[UPDATED_BY]]></text>
</staticText>
<staticText>
<reportElement x="529" y="0" width="26" height="20"/>
<textElement/>
<text><![CDATA[CUS_INV_STATUS]]></text>
</staticText>
</band>
</title>
<detail>
<band height="24" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{CUS_INV_DT}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="100" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{CUS_INV_NO}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="200" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{CUST_NAME}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="300" y="0" width="129" height="20"/>
<textElement/>
<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{CUS_ORD_NET_VAL}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="429" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{UPDATED_BY}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="529" y="0" width="26" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{CUS_INV_STATUS}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
当我尝试编译为jasper时,它显示以下错误
net.sf.jasperreports.engine.JRException: Document root element "jasperReport", must match DOCTYPE root "null".
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:242)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:225)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:213)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:167)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:151)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:107)
at com.inv.util.comp.main(comp.java:18)
Caused by: org.xml.sax.SAXParseException: Document root element "jasperReport", must match DOCTYPE root "null".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1745)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:238)
... 6 more