Jump to content
Changes to the Jaspersoft community edition download ×

Formatting output - money


Recommended Posts

I'm trying to display a column of money, which is currently a numeric data type (Postgres). The following syntax examples work pefectly in DBeaver, but produce errors in Jasper Studio. Does anyone have suggestions to display money ($79,967,345.23 for example)? I've tried dropping the postgresql-42.2.20.jre7.jar file (includes PG Money class) in to various folders containing other Jasper-related jar files, but continue to receive the error.

sum(d.revenue)::money --> Error: net.sf.jasperreports.engine.JRException: Unable to get value for result set field "sum" of class org.postgresql.util.PGmoney

cast(sum(d.revenue) as MONEY) --> Error: java.lang.ClassNotFoundException: org.postgresql.util.PGmoney cannot be found by net.sf.jasperreports_6.16.0.final --- net.sf.jasperreports.engine.design.JRDesignField@694ba313

If I use just "sum(d.revenue)", the correct information is displayed, but looks like a meaningless (hard-to-read) number. 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

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...