check the types of your report columns
Main Topics
Browse All TopicsHello all..... I am a recent Crystal Reports Convert, so forgive me for i know not what I do........
Ok so this is what I am trying to accomplish. I have one report that I want to support multiple tables. I want to be able to let the user select the tables at run time. My SQL statement looks like this:
SELECT
*
FROM
$P{store}
WHERE
value_char != '' AND server_time >= $P{Start} AND server_time <= $P{End}
order by cashier, value_char,server_time
It was working correcly before i tried to get fancy with the "$P{store}" in the from part.
Am I smoking crack thinking that I can accomplish this?
Thank you in advance for reading my request.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Just in case some one else is out looking for something like this here is the solution:
In my select statement :
SELECT
*
FROM
$P{store} <--------THIS IS WHERE THE ISSUE IS!!!!
WHERE
value_char != '' AND server_time >= $P{Start} AND server_time <= $P{End}
order by cashier, value_char,server_time
It Should actually look like this:
SELECT
*
FROM
$P!{store}
WHERE
value_char != '' AND server_time >= $P{Start} AND server_time <= $P{End}
order by cashier, value_char,server_time.
Thank you to Gaby38 on the jasperforge forums for this answer.
Business Accounts
Answer for Membership
by: chrobiPosted on 2009-01-03 at 22:49:39ID: 23288606
Well I gave up on trying the fancy stuff. So I moved the Select Statement to a stored procedure on MYSQL 5.0.45. SO I rebuilt the report from the ground up and tested with the stored procedure. All is good when I run the report in the IReport viewer using the stored procedure. When I uploaded to the jasper server it bombs with an error, this will be posted after the details on the report config and the server config.
r.api.JSEx ceptionWra pper: Unable to get value for field 'value_num' of class 'java.math.BigDecimal'
r.api.JSEx ceptionWra pper: net.sf.jasperreports.engin e.JRExcept ion: Unable to get value for field 'value_num' of class 'java.math.BigDecimal'
ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýý' in column 8. etBigDecim alFromStri ng(ResultS et.java:13 33) etNativeBi gDecimal(R esultSet.j ava:2889) etNativeBi gDecimal(R esultSet.j ava:2846) etBigDecim al(ResultS et.java:11 51) legatingRe sultSet.ge tBigDecima l(Delegati ngResultSe t.java:301 ) e.JRResult SetDataSou rce.getFie ldValue(JR ResultSetD ataSource. java:215)
e.JRExcept ion: Unable to get value for field 'value_num' of class 'java.math.BigDecimal' ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýý' in column 8. etBigDecim alFromStri ng(ResultS et.java:13 33) etNativeBi gDecimal(R esultSet.j ava:2889) etNativeBi gDecimal(R esultSet.j ava:2846) etBigDecim al(ResultS et.java:11 51) legatingRe sultSet.ge tBigDecima l(Delegati ngResultSe t.java:301 ) e.JRResult SetDataSou rce.getFie ldValue(JR ResultSetD ataSource. java:215)
ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýýý ýýýýýýýýý' in column 8.
The report has three input parameters Start_Date_Time (TimeStamp), End_Date_Time (TimeStamp), Table_Selection(Text)
The server has report unit with three input controls:
Start_Date_Time: This input control has local defined Data Type configured as Date/Time.
End_Date_Time: This input control has local defined Data Type configured as Date/Time.
Table_Selection: This input control has local defined Data Type configured as Text.
When I run the report on the server I am prompted for my three inputs Start Date, End Date, and Table_Selection. I enter the exact information that i had tested with in Ireport. And I get the following error:
In the error log I see :
Caused by: java.sql.SQLException: Bad format for BigDecimal ' != "" ORDER BY
This tells me that i have a bad format, but I dont know what part on the jasperserver to troubleshoot this any further.
Any and all help is greatly appreciated.
Chrobi
Error Log from server:
com.jaspersoft.jasperserve
com.jaspersoft.jasperserve
{
Truncated Part
}
Caused by: java.sql.SQLException: Bad format for BigDecimal ' != "" ORDER BY
' at line 3ýýýýýýýýýýýýýýýýýýýýýýýýý
at com.mysql.jdbc.ResultSet.g
at com.mysql.jdbc.ResultSet.g
at com.mysql.jdbc.ResultSet.g
at com.mysql.jdbc.ResultSet.g
at org.apache.commons.dbcp.De
at net.sf.jasperreports.engin
... 99 more
{
Truncated Part
}
net.sf.jasperreports.engin
Caused by: java.sql.SQLException: Bad format for BigDecimal ' != "" ORDER BY
' at line 3ýýýýýýýýýýýýýýýýýýýýýýýýý
at com.mysql.jdbc.ResultSet.g
at com.mysql.jdbc.ResultSet.g
at com.mysql.jdbc.ResultSet.g
at com.mysql.jdbc.ResultSet.g
at org.apache.commons.dbcp.De
at net.sf.jasperreports.engin
... 99 more
{
Truncated Part
}
java.sql.SQLException: Bad format for BigDecimal ' != "" ORDER BY ' at line 3ýýýýýýýýýýýýýýýýýýýýýýýýý