Jump to content
We've recently updated our Privacy Statement, available here ×

ireport query: cannot cast int to integer (solved)


rbalasus

Recommended Posts

ireport query: cannot cast int to integer
Hello, I try to create my first report with ireport.
Now I see the following problem. I want to use a query which gets a value through a paramater
select Value1 from Table1 where ID=$P(ID)
the value in the query should be an integer, how can I avoid this problem?
Regards Randolf Balasus
 



Post Edited by rbalasus at 08/21/2009 05:45
Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hello, thanx for your answer. My problem is very simple: the report is crashing because of this error message. I just only want to start the report with one parameter, and i want to use this parameter in my query. The datatype in the query seems to be "int" and in ireport i can only choose integer, these both types seems not to correspond, and i have this error above...

Thanx for any answer

Link to comment
Share on other sites

Hello, thanx for your answer.

I use iReprot 3.5.2

What do you mean by: The Report has no Paramater?

When I look into this .jrxml file, then I found this Line

"        <parameter name="ID" class="java.lang.String">"

What should I say: there is a Parameter named "ID", here in this example it is from type String, I have tested with the Parameter  type Int, in both cases I got this error: Cannot cast int to integer (int is the type in the java reporting software, and integer is the type from the tablecolumn in mysql)

Greetings Randolf Balasus

Link to comment
Share on other sites


I was recreating this report and it was working. I am not 100% sure what exactly triggers this error message.
in the query was a typo instead of
select value1 from mbus where ID = $P{ID} I wrote
select value1 from mbus where $P{ID} = ID
(column and parametername was not in the right order)
In the new report I was using different names for Column an Parameter, maybe this is  a problem too.

I was not using my parameter in SubDataset then in the mainquery.

And i was working in this order:
- creating report parameter, compiling testing
- using in query

But now all is working as expected.
thanx for your help

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