Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Number formatting - GUI
jimseconde
<p>Hi,</p>
<p> </p>
<p>I'm constantly running into formatting number problems in the report designer - the most likely cause is that I'm trying to use the GUI wherever I can rather than throwing in Java functions (this is not because I don't want to use them, it's because I've not used them before and putting them in the right binding or call is something I'm more likely to get wrong than right).</p>
<p> </p>
<p>I have a crosstab. I want the numerical values coming out to be truncated and suffixed.</p>
<p> </p>
<p>So, 21459882 to become 21.4M</p>
<p> </p>
<p>Suffix is easy - can be formatted in the format number pane in preferences.</p>
<p> </p>
<p>There is no method in this pane to truncate/round though.</p>
<p> </p>
<p>In the chart I have above this crosstab, number formatting through the GUI allowed you to use the 'multiplier', so I could specift 0.000001 with one decimal to get the desired result. However, for some reason this option isn't available in the preferences of the crosstab cell.</p>
<p> </p>
<p>I know this figure can be formatted somewhere...anyone?</p>
<p> </p>
<p>Thanks in advance.</p>
Find more posts tagged with
Comments
JFreeman
<p>Which version of BIRT are you using?</p>
<p>Can you attach a sample report with your described configuration where you aren't able to set the formatting how you want?</p>
jimseconde
<p>I'm not sure about the exact BIRT version, but as it's Eclipse Luna 4.4, I'm going to assume it's the latest 4.4.1 build. I downloaded it last week.</p>
<p> </p>
<p>Attached is the report and a sample raw data.</p>
<p> </p>
<p>Any help would be appreciated: I realise that these are fairly simple requests, but diving into BIRT for the first time is a little daunting when it comes to understanding the best way to do formatting and data manipulation and/or at which layer you do it at...</p>
JFreeman
<p>You can create a multiplier manually through scripting within the Data Binding on the cross tab.</p>
<p> </p>
<p style="margin-left:40px;">- Select the Crosstab</p>
<p style="margin-left:40px;">- Select the Binding tab in the Property Editor - Cross Tab</p>
<p style="margin-left:40px;">- Select the desired binding for your value and choose edit.</p>
<p style="margin-left:40px;">- Open the expression builder by selecting the fx button</p>
<p style="margin-left:40px;">- Added the multiplier using javascript syntax.</p>
<p> </p>
<p>For Example:</p>
<pre class="_prettyXprint _lang-js">
(dimension["Commercial"]["England and Wales CCJ Commercial Values"] * 0.000001)
</pre>
<p>Take a look at the modified version of your report I have attached. I have also changed the Data Type on the bindings to Float to preserve the precision so it will not get truncated as an Int. </p>
jimseconde
<p>Absolutely awesome, thanks so much. More importantly, it's given me the first nugget of info as to where the split of operators and formatting go!</p>
JFreeman
<p>I'm glad I could help.</p>
<p>Let us know if you have any additional questions.</p>