ypomonh Posted April 6, 2007 Share Posted April 6, 2007 I keep getting: org.xml.sax.SAXParseException: The content of element type "jasperReport" must match "(property*,import*,reportFont*,style*,subDataset*,parameter*,queryString?,field*,variable*,group*,background?,title?,pageHeader?,columnHeader?,detail?,columnFooter?,pageFooter?,lastPageFooter?,summary?)". both using jasperreports-1.2.3.jar & jasperreports-1.3.2.jar. Is there a way to find exactly which element(s) I'm missing for the template to be valid..? This is my minimal template: Code:<?xml version="1.0" encoding="utf-8"?><!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="myjr"> <queryString> <![CDATA[select name, chr, sal, street, city from pappat]]> </queryString> <field class="java.lang.String" name="name"/> <field class="java.lang.String" name="chr"/> <field class="java.lang.String" name="sal"/> <field class="java.lang.String" name="street"/> <field class="java.lang.String" name="city"/> <title> <band height="50"> <staticText> <reportElement height="15" width="180" y="0" x="0"/> <textElement/> <text>This is a title </text> </staticText> </band> </title> <pageHeader> <band/> </pageHeader> <columnHeader> <band height="20"> <staticText> <reportElement height="20" width="180" y="0" x="180"/> <textElement> <font isUnderline="true"/> </textElement> <text> <![CDATA[name]]> </text> </staticText> </band> </columnHeader> <columnHeader> <band height="20"> <staticText> <reportElement height="20" width="180" y="0" x="180"/> <textElement> <font isUnderline="true"/> </textElement> <text> <![CDATA[chr]]> </text> </staticText> </band> </columnHeader> <columnHeader> <band height="20"> <staticText> <reportElement height="20" width="180" y="0" x="180"/> <textElement> <font isUnderline="true"/> </textElement> <text> <![CDATA[sal]]> </text> </staticText> </band> </columnHeader> <columnHeader> <band height="20"> <staticText> <reportElement height="20" width="180" y="0" x="180"/> <textElement> <font isUnderline="true"/> </textElement> <text> <![CDATA[street]]> </text> </staticText> </band> </columnHeader> <columnHeader> <band height="20"> <staticText> <reportElement height="20" width="180" y="0" x="180"/> <textElement> <font isUnderline="true"/> </textElement> <text> <![CDATA[city]]> </text> </staticText> </band> </columnHeader> <detail> <band height="20"> <textField> <reportElement height="15" width="180" y="0" x="180"/> <textElement/> <textFieldExpression> <![CDATA[$F{name}]]> </textFieldExpression> </textField> <textField> <reportElement height="15" width="180" y="0" x="180"/> <textElement/> <textFieldExpression> <![CDATA[$F{chr}]]> </textFieldExpression> </textField> <textField> <reportElement height="15" width="180" y="0" x="180"/> <textElement/> <textFieldExpression> <![CDATA[$F{sal}]]> </textFieldExpression> </textField> <textField> <reportElement height="15" width="180" y="0" x="180"/> <textElement/> <textFieldExpression> <![CDATA[$F{street}]]> </textFieldExpression> </textField> <textField> <reportElement height="15" width="180" y="0" x="180"/> <textElement/> <textFieldExpression> <![CDATA[$F{city}]]> </textFieldExpression> </textField> </band> </detail> <columnFooter> <band/> </columnFooter> <pageFooter> <band/> </pageFooter> </jasperReport> Link to comment Share on other sites More sharing options...
3rwin Posted April 6, 2007 Share Posted April 6, 2007 This is the xml source of an empty report generated by iReport: Code:<?xml version="1.0" encoding="UTF-8" ?><!-- Created with iReport - A designer for JasperReports --><!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><jasperReport name="simple" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="2" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="50" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="50" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="30" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="100" isSplitAllowed="true" > </band> </detail> <columnFooter> <band height="30" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="50" isSplitAllowed="true" > </band> </pageFooter> <lastPageFooter> <band height="50" isSplitAllowed="true" > </band> </lastPageFooter> <summary> <band height="50" isSplitAllowed="true" > </band> </summary></jasperReport> Hope this helps. 3rwin. Link to comment Share on other sites More sharing options...
ypomonh Posted April 6, 2007 Author Share Posted April 6, 2007 It did, thanks :woohoo: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now