Jump to content
JasperReports Library 7.0 is now available ×

Possible bug in JRVerifier


Recommended Posts

By: Michael Thorpe - michaelthorpe

Possible bug in JRVerifier

2005-09-11 00:57

Hi

 

I am working on a project to convert legacy reports to JasperReports.

 

I am using the JasperDesign API to create the JasperReport.

 

If I attempt to directly the resulting design like this

 

JasperCompileManager.compileReport( design );

 

I get the following error :-

 

java.lang.NullPointerException

at java.lang.Class.isAssignableFrom(Native Method)

at net.sf.jasperreports.engine.design.JRVerifier.verifyVariables(JRVerifier.java:558)

at net.sf.jasperreports.engine.design.JRVerifier.verifyDesign(JRVerifier.java:133)

at net.sf.jasperreports.engine.design.JRVerifier.verifyDesign(JRVerifier.java:106)

at net.sf.jasperreports.engine.design.JRJdtCompiler.compileReport(JRJdtCompiler.java:90)

at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)

at com.bnpparibas.fxo.rw_translator.JasperDesignTest.testFormattingStatementAtFieldLevel(JasperDesignTest.java:200)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)

 

However if I write out the JRXML and compile from file like this

 

JasperCompileManager.compileReport( "test/output/out.jrxml" );

 

It works fine.

 

Below is a test JRXML file

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

 

<jasperReport name="xx" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30">

<reportFont name="FXO_fixed_width" isDefault="true" fontName="Monospaced" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<queryString><![CDATA[select C1, C2, C3 from tmp]]></queryString>

<field name="C1" class="java.lang.Integer">

</field>

<field name="C2" class="java.lang.String">

</field>

<field name="C3" class="java.util.Date">

</field>

<variable name="var1" class="java.lang.Integer" calculation="System">

<initialValueExpression><![CDATA[new java.lang.Integer(102)]]></initialValueExpression>

</variable>

<detail>

<band height="14">

<textField pattern="zzzn">

<reportElement positionType="Float" x="60" y="0" width="60" height="14"/>

<textElement/>

<textFieldExpression class="java.lang.Integer"><![CDATA[$F{C1}]]></textFieldExpression>

</textField>

</band>

</detail>

</jasperReport>

 

 

The problem is with the InitialValueExpression on the variable var1.

 

Anybody have any thoughts?

 

Regards

 

Michael Thorpe

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...