supressing leading zeroes ... again

hi,

i need to suppress leading zeroes in my ireport field (type: string)
eg., "0004" should be "4".

someone gave me some help in this forum (sourceforge) the code is given below .. but did not compile correctly. Can some kind soul help me with the syntax and whether this will work ...

new integer().valueOf($F{fieldname})

P.S.: the database field is in string. i have changed the ireport field to "java.lang.integer"


Thanks ..

Tony
tt_linux's picture
Joined: Jul 17 2006 - 11:11pm
Last seen: 16 years 10 months ago

2 Answers:

Use this expression:


Integer.valueOf( $F{fieldname})


Giulio
giulio's picture
71619
Joined: Jan 2 2007 - 4:15pm
Last seen: 2 weeks 5 days ago

Hi,

Use this in your Sql Query

Ltrim(fieldName, '0') as NewFieldname

Directly use 'NewFieldName' in Jasper.

 

Duggu09's picture
301
Joined: Feb 24 2016 - 10:59am
Last seen: 4 years 1 month ago
Feedback
randomness