Jump to content
JasperReports Library 7.0 is now available ×

ireport - amount in words


kacheek

Recommended Posts

i have an sql that calculates total amount for invoice, which goes like

 

select sum(total), name,...

from tbl_X

where ....

 

however, i dunno how to convert amount in numerics (USD1345.00) into words (USD one thousand three hundred ...). how can i do that? btw, i'm using Oracle as my database. pls guide me step by step as i'm very new with ireport. thanks...

Post edited by: kacheek, at: 2006/11/22 00:40

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

It might be easier not to use iReport to convert the number to words at all. Consider wrapping the select statement in a stored procedure that generates the figures in words and returns them in the same format as the sql select would. Then just use the procedure as a data source instead of the query.

 

The code wouldn't be that bad. The procedure would have to:

-Get each digit and its magnitude (tens, hundreds, thousands)

-Get the string value of each digit/magnitude pair and stick them all together.

 

No idea what it would look like in pl/sql, hopefully you have a DBA that can help you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...