•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 423,578 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,425 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1180 | Replies: 3
![]() |
•
•
Join Date: Aug 2007
Location: Somewhere between heaven and hell
Posts: 100
Reputation:
Rep Power: 2
Solved Threads: 7
Dear all,
I have query like this :
SELECT ID, NAME, BEGINNINGBALANCE FROM TRXBUDGET ORDER BY ID
BEGINNINGBALANCE is numeric field type in MySQL.
Jasper Report / iReport recognizes this field as String, when I change the field type to Double, raises error like these :
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. Cannot cast from String to Double value = (java.lang.Double)(((java.lang.String)field_BEGINNINGBALANCE .getValue()));//$JR_EXPR_ID=14$ <----------------------------------------------------------------> 2. Cannot cast from String to Double value = (java.lang.Double)(((java.lang.String)field_BEGINNINGBALANCE .getOldValue()));//$JR_EXPR_ID=14$ <-------------------------------------------------------------------> 3. Cannot cast from String to Double value = (java.lang.Double)(((java.lang.String)field_BEGINNINGBALANCE .getValue()));//$JR_EXPR_ID=14$ <----------------------------------------------------------------> 3 errors
What should I do to change the format ?
I think I should use Text Field Expression, but I dont know how to do that
and.. I also want to format it to be "##,###,###.#0"
Thanks,
Kusno.
I have query like this :
SELECT ID, NAME, BEGINNINGBALANCE FROM TRXBUDGET ORDER BY ID
BEGINNINGBALANCE is numeric field type in MySQL.
Jasper Report / iReport recognizes this field as String, when I change the field type to Double, raises error like these :
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. Cannot cast from String to Double value = (java.lang.Double)(((java.lang.String)field_BEGINNINGBALANCE .getValue()));//$JR_EXPR_ID=14$ <----------------------------------------------------------------> 2. Cannot cast from String to Double value = (java.lang.Double)(((java.lang.String)field_BEGINNINGBALANCE .getOldValue()));//$JR_EXPR_ID=14$ <-------------------------------------------------------------------> 3. Cannot cast from String to Double value = (java.lang.Double)(((java.lang.String)field_BEGINNINGBALANCE .getValue()));//$JR_EXPR_ID=14$ <----------------------------------------------------------------> 3 errors
What should I do to change the format ?
I think I should use Text Field Expression, but I dont know how to do that
and.. I also want to format it to be "##,###,###.#0"
Thanks,
Kusno.
NEVER NEVER NEVER GIVE UP
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: Formatting Console output
- Next Thread: First, best, worst fit java program - need help debugging


Linear Mode