isa Posted January 22, 2007 Share Posted January 22, 2007 hello everyone, i m a new user and start working on the iReports , i faced a little bit problem when i add a new parameter and change the query and want my query select the result based on that parameter value which i set 1 as in the default value box, here is the code that we write in Report Query : select * from countrieswhere CountryID=$P{ValueID} but when i compiled it gives me follwing error : net.sf.jasperreports.engine.JRException:ÂErrorsÂwereÂencounteredÂwhenÂcompilingÂreportÂexpressionsÂclassÂfile: 1.ÂCannotÂcastÂfromÂintÂtoÂInteger ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂvalueÂ=Â(java.lang.Integer)(1); ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ<--------------------> 2.ÂCannotÂcastÂfromÂintÂtoÂInteger ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂvalueÂ=Â(java.lang.Integer)(1); ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ<--------------------> 3.ÂCannotÂcastÂfromÂintÂtoÂInteger ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂvalueÂ=Â(java.lang.Integer)(1); ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ<--------------------> 3Âerrors ÂÂÂÂ plz help me , and kindly provide me some good tutorial or share some read material on iReport if u have any. Thanx in Advance.wait for reply .... Link to comment Share on other sites More sharing options...
jaspg Posted January 22, 2007 Share Posted January 22, 2007 I have de same problem working with the 1.3.0 release de ireport. I solve this reinstalling the release 1.2.8. Link to comment Share on other sites More sharing options...
wegnerk Posted January 23, 2007 Share Posted January 23, 2007 How is your parameter defined? did you tried: select * from countrieswhere CountryID=$P{ValueID}.intValue() The problem is, that your parameter is an Integer, but the CountryID from the DB is only int. Don't know, if that can help a bit... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now