Jump to content

Can't compile jrxml file because of list component


maxr

Recommended Posts

Hello,

I'm working with JapserReports 3.7.1 and cannot compile my created *.jrxml file.

I'm getting the following error message:

org.xml.sax.SAXParseException: Validation error: line: 264; col: 247; {http://jasperreports.sourceforge.net/jasperreports/components}:list : Element is not allowed.

 

line 264 and the following ones of the *.jrxml file:

  <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
     <datasetRun subDataset="dataset1">
      <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{LIST_PARAMETER})]]></dataSourceExpression>
     </datasetRun>
     <jr:listContents height="19" width="181">
      <textField>
       <reportElement x="0" y="0" width="181" height="19"/>
       <textElement verticalAlignment="Top" lineSpacing="Single">
        <font fontName="Arial" isBold="true" isUnderline="false"/>
       </textElement>
       <textFieldExpression class="java.lang.String"><![CDATA["• "+$F{name}]]></textFieldExpression>
      </textField>
     </jr:listContents>
    </jr:list>

 

*edit: the parameter $P{LIST_PARAMETER} contains an ArrayList of Objects

the field $F{name} shows the String Object.getName();

What can be the source of my problem?

thanks in advance.

 

Max R

 



 



Post Edited by maxr at 08/05/2010 11:15
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Thanks for your answers, bruno.

My application is running on a server.

If I try to compile the *.jrxml on my local machine it works....

 

Libraries and JR version on server and local machine are identical .

I am still trying to find the reason for that.

Link to comment
Share on other sites

Hey,

my problem is finally solved. My colleague added following line to the java source code:

JRProperties.setProperty(JRProperties.COMPILER_XML_VALIDATION,false); 

 

In the jrxml-file we added the attribute 'language="java"' in the first tag.

After that my jrxml is compiled correctly without throwing an exception.

 

Cheers

MaxR

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...