shatad0101 Posted June 23, 2011 Share Posted June 23, 2011 Hi, I am sharad and i m new in ireport and currently i am using ireport 4.0.0 versionand i am getting some errorCode:Today I was trying to use parameter in where clausesuch as-- select emp_salary,last_namefrom employeeswhere emp_id in ($p{id1},$p{id2}) but i m getting error so how tofigure out this problem plz help me Is it possible to do such a thing with iReport and JasperReport ? Link to comment Share on other sites More sharing options...
augarte Posted June 23, 2011 Share Posted June 23, 2011 Which error are you getting?I had the same problem as you and I found a link saying that the sintax of SQL parameters is '$P{param}' and the sintax or iReport parameters is '$P!{param}'. Try defining your query in the following way: select emp_salary,last_name from employees where emp_id in ($p!{id1},$p!{id2}) Hope this helps. Link to comment Share on other sites More sharing options...
shatad0101 Posted June 23, 2011 Author Share Posted June 23, 2011 Thanx Augarte for reply, i have tried this but still i m not getting solutionPost Edited by shatad0101 at 06/23/2011 07:40 Link to comment Share on other sites More sharing options...
augarte Posted June 23, 2011 Share Posted June 23, 2011 And which error are you getting? Knowing the error will be easier to figure out why is this happening. Link to comment Share on other sites More sharing options...
shatad0101 Posted June 23, 2011 Author Share Posted June 23, 2011 I have defined two parameter name system_name1,system_name2 as value expression text and default value for system_name1 is xyz and for system_name2 is abc where system_name in ($P!{system1},$P{system2!}) error-sourcefile inline evaluation of : ''xyz:" illegal use of undefined variable class,or void literal Link to comment Share on other sites More sharing options...
augarte Posted June 23, 2011 Share Posted June 23, 2011 So what I understand is you have two parameters "system1_name" and "system2_name". You set a default value for each one, as it is a string it should be between double quotes.If the names of the parameters are system1_name and system2_name the where clause should be like follows: where system_name in ($P!{system1_name},$P!{system2_name})If everything is defined as specified here it should work ok. If you want you can attach the jrxml file and will check if everthing is ok. Regards. Link to comment Share on other sites More sharing options...
shatad0101 Posted June 23, 2011 Author Share Posted June 23, 2011 sorry name of parameter are system1,system2 but i am doing same thing as u said-- select .............where system_name in ($P!{system1},$P!{system2})and.........group by .............. i found another link for this http://jasperreports.sourceforge.net/sample.reference/query/index.htmlhere method is different Link to comment Share on other sites More sharing options...
shatad0101 Posted June 23, 2011 Author Share Posted June 23, 2011 Thanx Augart now problem is solved , i was mistaking in default value of parameter .i was giving only xyz and after ur reply i gave "xyz " now its working.once again thanx for help Link to comment Share on other sites More sharing options...
shatad0101 Posted June 23, 2011 Author Share Posted June 23, 2011 my email id is sharad0101@ymail.com if u have any ebook related to ireport plz send me Link to comment Share on other sites More sharing options...
shatad0101 Posted June 24, 2011 Author Share Posted June 24, 2011 shatad0101Wrote: now i am trying to submit my ireport into the jasperreportserver but i m getting error- Code: Post Edited by shatad0101 at 07/27/2011 09:48 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