Jump to content
We've recently updated our Privacy Statement, available here ×

printWhenExpression & java.lang.ClassCastException


choang

Recommended Posts

Hello,

I am running iReport 1.3.3.  And when I compiled my .jrxml file which contains the following code :

...

<printWhenExpression>

   new java.lang.Boolean($P{numTRCBugs} != 0)

</printWhenExpression>

..........

where numTRCBugs is java.lang.Integer

I got the following compile-time error :

"net.sf.jasperreports.engine.JRException: java.lang.IllegalArgumentException: 

Cannot invoke net.sf.jasperreports.engine.design.JRDesignElement.setPrintWhenExpression -

 java.lang.ClassCastException@8b9227"

I wonder if someone could please tell me how to fix this problem?

Thank you very much.

Akino

  

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

teodord
Wrote:

Hi,

 

Try

 

<printWhenExpression>

   Boolean.valueOf($P{numTRCBugs},intValue() != 0)

</printWhenExpression>

 

I hope this helps.
Teodor

 

Note the comma, I believe that should be:

 

<printWhenExpression>

   Boolean.valueOf($P{numTRCBugs}.intValue() != 0)

</printWhenExpression>

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