Jump to content
JasperReports Library 7.0 is now available ×

Casting problem in ireport


Gajanan

Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

You have to be explicit with just about everything you do. Even a simple Default Value Expression needs to be cast correctly. For example, if you have a Patameter or Variable of (say) type java.lang.Integer then the expression for a default value of zero is not 0, it is new java.lang.Integer(0).

 

 

The only exception is java.lang.String objects, where you can simply enter a literal string in double quotes.

 

 

Often you will need to recast several times if you are doing calculations or formatting. The following example might help you to understand it better: http://www.jasperforge.org/index.php?option=com_mamblog&Itemid=109&task=show&action=view&id=239&Itemid=109 Check the section headed "Method 2. The Hard Way" as it breaks down a cast from Double to Long and back to Double for you.

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