supressing leading zeroes ... again

0
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: 13 years 4 months ago

2 Answers:

0
Use this expression:


Integer.valueOf( $F{fieldname})


Giulio
giulio's picture
27406
Joined: Jan 2 2007 - 4:15pm
Last seen: 9 months 1 week ago
0

Hi,

Use this in your Sql Query

Ltrim(fieldName, '0') as NewFieldname

Directly use 'NewFieldName' in Jasper.

 

Duggu09's picture
29
Joined: Feb 24 2016 - 10:59am
Last seen: 7 months 2 weeks ago
Feedback