Invalid content was found starting with element \'style\'

0

Hi every one i'm a new bie here need small help to get going

I'm using iReport 3.7.5 and generated a JRXML file with it

I've inserted the jrxml file in the code column

Now when i'm trying to generate a PDF file through jasper reports it is throwing an saxparseException here is the exception trace and also let me list the jars i'm using for it

Please help me to get through this issue thanks in advance


jasperreports-3.7.5                                        commons-digester-1.7

jcommon-1.0.15                                              commons-logging-1.1

commons-beanutils-1.8.0                            groovy-all-1.5.5

commons-collections-3.2.1                         iText-2.1.7

poi-3.6-20091214                                           jfreechart-1.0.12

 



Jan 21, 2011 11:20:14 AM org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 9 column 22: cvc-complex-type.2.4.a: Invalid content was found starting with element 'style'. One of '{"http://jasperreports.sourceforge.net/jasperreports":parameter, "http://jasperreports.sourceforge.net/jasperreports":queryString, "http://jasperreports.sourceforge.net/jasperreports":field, "http://jasperreports.sourceforge.net/jasperreports":sortField, "http://jasperreports.sourceforge.net/jasperreports":variable, "http://jasperreports.sourceforge.net/jasperreports":filterExpression, "http://jasperreports.sourceforge.net/jasperreports":group, "http://jasperreports.sourceforge.net/jasperreports":background, "http://jasperreports.sourceforge.net/jasperreports":title, "http://jasperreports.sourceforge.net/jasperreports":pageHeader, "http://jasperreports.sourceforge.net/jasperreports":columnHeader, "http://jasperreports.sourceforge.net/jasperreports":detail, "http://jasperreports.sourceforge.net/jasperreports":columnFooter, "http://jasperreports.sourceforge.net/jasperreports":pageFooter, "http://jasperreports.sourceforge.net/jasperreports":lastPageFooter, "http://jasperreports.sourceforge.net/jasperreports":summary, "http://jasperreports.sourceforge.net/jasperreports":noData}' is expected.
org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'style'. One of '{"http://jasperreports.sourceforge.net/jasperreports":parameter, "http://jasperreports.sourceforge.net/jasperreports":queryString, "http://jasperreports.sourceforge.net/jasperreports":field, "http://jasperreports.sourceforge.net/jasperreports":sortField, "http://jasperreports.sourceforge.net/jasperreports":variable, "http://jasperreports.sourceforge.net/jasperreports":filterExpression, "http://jasperreports.sourceforge.net/jasperreports":group, "http://jasperreports.sourceforge.net/jasperreports":background, "http://jasperreports.sourceforge.net/jasperreports":title, "http://jasperreports.sourceforge.net/jasperreports":pageHeader, "http://jasperreports.sourceforge.net/jasperreports":columnHeader, "http://jasperreports.sourceforge.net/jasperreports":detail, "http://jasperreports.sourceforge.net/jasperreports":columnFooter, "http://jasperreports.sourceforge.net/jasperreports":pageFooter, "http://jasperreports.sourceforge.net/jasperreports":lastPageFooter, "http://jasperreports.sourceforge.net/jasperreports":summary, "http://jasperreports.sourceforge.net/jasperreports":noData}' is expected.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1647)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:241)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:228)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:216)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:170)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:154)
    at com.datatreis.reports.ReportGenerator.generatePDF(ReportGenerator.java:67)
    at com.datatreis.reports.ReportGenerator.main(ReportGenerator.java:213)
net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'style'. One of '{"http://jasperreports.sourceforge.net/jasperreports":parameter, "http://jasperreports.sourceforge.net/jasperreports":queryString, "http://jasperreports.sourceforge.net/jasperreports":field, "http://jasperreports.sourceforge.net/jasperreports":sortField, "http://jasperreports.sourceforge.net/jasperreports":variable, "http://jasperreports.sourceforge.net/jasperreports":filterExpression, "http://jasperreports.sourceforge.net/jasperreports":group, "http://jasperreports.sourceforge.net/jasperreports":background, "http://jasperreports.sourceforge.net/jasperreports":title, "http://jasperreports.sourceforge.net/jasperreports":pageHeader, "http://jasperreports.sourceforge.net/jasperreports":columnHeader, "http://jasperreports.sourceforge.net/jasperreports":detail, "http://jasperreports.sourceforge.net/jasperreports":columnFooter, "http://jasperreports.sourceforge.net/jasperreports":pageFooter, "http://jasperreports.sourceforge.net/jasperreports":lastPageFooter, "http://jasperreports.sourceforge.net/jasperreports":summary, "http://jasperreports.sourceforge.net/jasperreports":noData}' is expected.
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:245)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:228)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:216)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:170)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:154)
    at com.datatreis.reports.ReportGenerator.generatePDF(ReportGenerator.java:67)
    at com.datatreis.reports.ReportGenerator.main(ReportGenerator.java:213)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'style'. One of '{"http://jasperreports.sourceforge.net/jasperreports":parameter, "http://jasperreports.sourceforge.net/jasperreports":queryString, "http://jasperreports.sourceforge.net/jasperreports":field, "http://jasperreports.sourceforge.net/jasperreports":sortField, "http://jasperreports.sourceforge.net/jasperreports":variable, "http://jasperreports.sourceforge.net/jasperreports":filterExpression, "http://jasperreports.sourceforge.net/jasperreports":group, "http://jasperreports.sourceforge.net/jasperreports":background, "http://jasperreports.sourceforge.net/jasperreports":title, "http://jasperreports.sourceforge.net/jasperreports":pageHeader, "http://jasperreports.sourceforge.net/jasperreports":columnHeader, "http://jasperreports.sourceforge.net/jasperreports":detail, "http://jasperreports.sourceforge.net/jasperreports":columnFooter, "http://jasperreports.sourceforge.net/jasperreports":pageFooter, "http://jasperreports.sourceforge.net/jasperreports":lastPageFooter, "http://jasperreports.sourceforge.net/jasperreports":summary, "http://jasperreports.sourceforge.net/jasperreports":noData}' is expected.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1647)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:241)
    ... 6 more
 

Regards

Path

 

 

 

Code:
<?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 <a href="http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"" target="_blank">http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"</a> name="tiescompanies" 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="logo_image" class="java.lang.String">
		<defaultValueExpression><![CDATA["logo_image"]]></defaultValueExpression>
	</parameter>
	<style name="table">
		<box>
			<pen lineWidth="1.0" lineColor="#000000"/>
		</box>
	</style>
	<style name="table_TH" mode="Opaque" backcolor="#BDB4AA">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table_CH" mode="Opaque" backcolor="#FFF4E6">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
		<conditionalStyle>
			<conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==0)]]></conditionExpression>
			<style backcolor="#FFFCF8"/>
		</conditionalStyle>
	</style>
	<style name="table 1">
		<box>
			<pen lineWidth="1.0" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 1_TH" mode="Opaque" backcolor="#D9CFC3">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 1_CH" mode="Opaque" backcolor="#FFF3E6">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 1_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
		<conditionalStyle>
			<conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==0)]]></conditionExpression>
			<style backcolor="#FFFCF8"/>
		</conditionalStyle>
	</style>
	<style name="table 2">
		<box>
			<pen lineWidth="1.0" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 2_TH" mode="Opaque" backcolor="#D9CFC3">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 2_CH" mode="Opaque" backcolor="#FFF3E6">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 2_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
		<conditionalStyle>
			<conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==0)]]></conditionExpression>
			<style backcolor="#FFFCF8"/>
		</conditionalStyle>
	</style>
	<style name="table 3">
		<box>
			<pen lineWidth="1.0" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 3_TH" mode="Opaque" backcolor="#C3CFD9">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 3_CH" mode="Opaque" backcolor="#E6F3FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 3_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<subDataset name="Table Dataset 1"/>
	<subDataset name="Table Dataset 2"/>
	<subDataset name="New Dataset 1">
		<queryString language="SQL">
			<![CDATA[select uniqueid, name, gs1companyprefix, status from businessentity]]>
		</queryString>
		<field name="uniqueid" class="java.lang.Integer"/>
		<field name="name" class="java.lang.String"/>
		<field name="gs1companyprefix" class="java.lang.String"/>
		<field name="status" class="java.lang.String"/>
	</subDataset>
	<queryString>
		<![CDATA[select uniqueid,name,gs1companyprefix,status from businessentity]]>
	</queryString>
	<field name="uniqueid" class="java.lang.Integer"/>
	<field name="name" class="java.lang.String"/>
	<field name="gs1companyprefix" class="java.lang.String"/>
	<field name="status" class="java.lang.String"/>
	<sortField name="PAGE_NUMBER" type="Variable"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="79" splitType="Stretch">
			<staticText>
				<reportElement x="168" y="14" width="219" height="38"/>
				<textElement textAlignment="Justified">
					<font size="24" isBold="true"/>
				</textElement>
				<text><![CDATA[TIES REPORTS]]></text>
			</staticText>
		</band>
	</title>
	<pageHeader>
		<band height="35" splitType="Stretch">
			<image>
				<reportElement x="0" y="0" width="74" height="35"/>
				<parameter name="logoImage" class="java.lang.String" isForPrompting="false"/>
				<imageExpression class="java.lang.String"><![CDATA[$P{logo_image}]]></imageExpression>
			</image>
			<staticText>
				<reportElement x="168" y="0" width="200" height="20"/>
				<textElement textAlignment="Justified">
					<font size="14" isBold="true"/>
				</textElement>
				<text><![CDATA[Company Names Report]]></text>
			</staticText>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="61" splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band height="125" splitType="Stretch">
			<componentElement>
				<reportElement key="table 2" style="table 2" isPrintRepeatedValues="false" x="27" y="11" width="360" height="80"/>
				<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components <a href="http://jasperreports.sourceforge.net/xsd/components.xsd">" target="_blank">http://jasperreports.sourceforge.net/xsd/components.xsd"></a>
					<datasetRun subDataset="New Dataset 1">
						<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
					</datasetRun>
					<jr:column width="90">
						<jr:columnHeader style="table 2_CH" height="30" rowSpan="1">
							<staticText>
								<reportElement x="0" y="0" width="90" height="30"/>
								<textElement/>
								<text><![CDATA[uniqueid]]></text>
							</staticText>
						</jr:columnHeader>
						<jr:detailCell style="table 2_TD" height="20" rowSpan="1">
							<textField>
								<reportElement x="0" y="0" width="90" height="20"/>
								<textElement/>
								<textFieldExpression class="java.lang.Integer"><![CDATA[$F{uniqueid}]]></textFieldExpression>
							</textField>
						</jr:detailCell>
					</jr:column>
					<jr:column width="90">
						<jr:columnHeader style="table 2_CH" height="30" rowSpan="1">
							<staticText>
								<reportElement x="0" y="0" width="90" height="30"/>
								<textElement/>
								<text><![CDATA[name]]></text>
							</staticText>
						</jr:columnHeader>
						<jr:detailCell style="table 2_TD" height="20" rowSpan="1">
							<textField>
								<reportElement x="0" y="0" width="90" height="20"/>
								<textElement/>
								<textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression>
							</textField>
						</jr:detailCell>
					</jr:column>
					<jr:column width="90">
						<jr:columnHeader style="table 2_CH" height="30" rowSpan="1">
							<staticText>
								<reportElement x="0" y="0" width="90" height="30"/>
								<textElement/>
								<text><![CDATA[gs1companyprefix]]></text>
							</staticText>
						</jr:columnHeader>
						<jr:detailCell style="table 2_TD" height="20" rowSpan="1">
							<textField>
								<reportElement x="0" y="0" width="90" height="20"/>
								<textElement/>
								<textFieldExpression class="java.lang.String"><![CDATA[$F{gs1companyprefix}]]></textFieldExpression>
							</textField>
						</jr:detailCell>
					</jr:column>
					<jr:column width="90">
						<jr:columnHeader style="table 2_CH" height="30" rowSpan="1">
							<staticText>
								<reportElement x="0" y="0" width="90" height="30"/>
								<textElement/>
								<text><![CDATA[status]]></text>
							</staticText>
						</jr:columnHeader>
						<jr:detailCell style="table 2_TD" height="20" rowSpan="1">
							<textField>
								<reportElement x="0" y="0" width="90" height="20"/>
								<textElement/>
								<textFieldExpression class="java.lang.String"><![CDATA[$F{status}]]></textFieldExpression>
							</textField>
						</jr:detailCell>
					</jr:column>
				</jr:table>
			</componentElement>
		</band>
	</detail>
	<columnFooter>
		<band height="45" splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="54" splitType="Stretch">
			<textField>
				<reportElement x="320" y="19" width="80" height="20"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report">
				<reportElement x="400" y="19" width="40" height="20"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField pattern="dd/MM/yyyy HH.mm.ss">
				<reportElement x="14" y="22" width="100" height="20"/>
				<textElement/>
				<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<summary>
		<band height="42" splitType="Stretch"/>
	</summary>
</jasperReport>
</td></tr></tbody></table>
pathfinder123's picture
Joined: Jan 20 2011 - 9:36pm
Last seen: 3 years 11 months ago

1 Answer:

0

Hi,

 

Your JRXML is invalid. It does not contain tags in the propert order. Have you edited it manually? I suggest you stick with iReport.

If you plan to make manual edits of the JRXML, then please make sure you have the Schema Reference at hand and that modifications you make do not result in invalid JRXMLs.

http://jasperreports.sourceforge.net/schema.reference.html

 

I have attached a copy of your report after I made some corrections in it.

 

I hope this helps.
Teodor

 

teodord's picture
4499
Joined: Jun 30 2006 - 9:00am
Last seen: 16 hours 56 min ago
Feedback
randomness