Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Wrapping a currency column
Rejilal
Hi,
I am using BIRT 2.5.1
In my report i have some currency columns.Data type is float.
My requirement is if big amounts are coming amounts should be wrapped to second line.Right now amount are not wrapped and some part of the amounts are getting hidden.
I tried a sample report with a string data type and that time wrapping is happening.But I need to get the same with float data type.
Could any one please help me to solve this.?
Thanks,
-Reji
Find more posts tagged with
Comments
JustME
I believe the reason the float number won't wrap is because for wrapping to work, there needs to be a space somewhere in your number. Since floats don't have spaces in them, it doesn't know where to wrap.
For display purposes, my solution is as follows. Add a computed column to your data set and use the following code in the expression:
<code>
d=row["PRICEEACH"]*600/.35;
d=d.toString();
a=d.substring(0,8);
b=d.substring(9,d.length);
d=a + " " + b;
d;
</code>
d=row["PRICEEACH"]*600/.35; **getting number from priceeach and calculating to make number exceed cell width
d=d.toString(); **converting number to string for manipulation
a=d.substring(0,8); **getting first 9 characters of string
b=d.substring(9,d.length); **getting rest of string
d=a + " " + b; **displaying both substrings with space between them (so system has a space to use for wrapping)
d; **return string with space for wrapping
You can perform mathematical calculations on the priceeach float from the dataset....but display the string to the user.
The sample report is attached.