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)
How to create new Custom Formatter for data column
Atul Arora
<p>We have requirement to format the data of a data set columns on the basis of custom formatting.</p>
<p>Data set column format will not be static or fixed for that column. It will depend on the logged in user.</p>
<p> </p>
<p>For e.g. for same locale en_US one user needs to see date in MM-DD-YYYY format and other user will see the data in MMMM d, y</p>
<p> </p>
<p>Is there a way to create a new custom formatter which will take the data raw value and rendering formats as input and displays the data in that format.</p>
<p> </p>
<p>Or DO i have an access of reportContext object in the custom formatter classes which can pick the loggedIn user rendering format from that context.</p>
<p> </p>
<p>I am assuming if aggregations applied on Numerical columns will take care of formatting aggregate data on those specified custom format.</p>
Find more posts tagged with
Comments
micajblock
<p>Let me make sure I understand the requirement. Do you want to change the format the data based on the users locale that is different than what BIRT provides? BIRT automatically does locale based formatting. </p>
<p> </p>
<p>Also is this for iHub or OS BIRT?</p>
cocou
<p>Hello, i don't know if my problem is the same as yours. </p>
<p>But i would like to create and integrate a custom formatter for numbers. </p>
<p>This formatter must translate number in letter like : 2000 will be format as two thousant euro in english and deux mille en francais. </p>
<p> </p>
<p>this is an exemple of formatter method i want to use: </p>
<p> </p>
<blockquote class="ipsBlockquote">
<p> </p>
<p>private String getMontantLettre(Number value) {</p>
<div>NumberFormat nombreEnLettreFormat = new RuleBasedNumberFormat(Locale.FRANCE, RuleBasedNumberFormat.SPELLOUT);</div>
<div>int partieEntiere = value.intValue();</div>
<div>int partieDecimale= new Double(((value.doubleValue() - partieEntiere) *100)).intValue();</div>
<div> </div>
<div>String montantLettre = nombreEnLettreFormat.format(partieEntiere) + " euros " + (partieDecimale>0 ? nombreEnLettreFormat.format(partieDecimale) + (partieDecimale>1? " cents " : "cent") :"");</div>
<div>return montantLettre;</div>
<div>}</div>
<div> </div>
</blockquote>
<p> </p>
<p><span style="color:rgb(164,164,164);font-family:arial, sans-serif;">Regards,</span></p>
Clement Wong
<p>This does not appear related to iHub, and there is another post you started in this section that I moved to the Integrating with BIRT Runtime section (<a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/forum/9-integrating-with-birt-runtime/'>http://developer.actuate.com/community/forum/index.php?/forum/9-integrating-with-birt-runtime/</a>)
. </p>
<p> </p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/39429-how-to-create-and-add-a-new-numberformatter-by-java-developping/'>http://developer.actuate.com/community/forum/index.php?/topic/39429-how-to-create-and-add-a-new-numberformatter-by-java-developping/</a></p>
;