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)
Numbers to Words
jfreak53
Ok, so I know there is probably not a function for this ha ha
But does anyone have a script they have made in the past to turn numbers into letter, i.e. 23 - twenty-three
I am grabbing some data from MySQL and in one of the table I have to put that.
Find more posts tagged with
Comments
johnw
Nothing that is ready for BIRT. I do have a function I wrote for an embedded platform that I was using as a clock.
Your best bet is to look for a Java class that does this, and include the JAr file in your classpath, or write a extension to the User Script extension point and include it as a plugin.
jfreak53
Ok, so I found this one:<br />
<a class='bbc_url' href='
http://www.java-samples.com/showtutorial.php?tutorialid=1156'>http://www.java-samples.com/showtutorial.php?tutorialid=1156</a><br
/>
<br />
I saved to .java, then compiled, then compressed into .jar. I have included it in my report, then I made a dynamic text, then in the onRender of this text I put:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>this.text = originalNumToLetter(24);</pre>
<br />
Now I get this error:<br />
<br />
<blockquote class='ipsBlockquote' ><p>ReferenceError: "originalNumToLetter" is not defined. (/report/body/text-data[
@id="
;7"]/method[
@name="
;onRender"]#1)</p></blockquote>
<br />
What did I do wrong? I tested this script from the command prompt running it from java and passing a number as an inline param. Do I need to change something in it to make it work for BIRT?<br />
<br />
Thanks for the help.
jfreak53
Ok never mind I ended up using a JS file to do the same thing, we're good thanks for the help.