2005 IR Help Posted September 2, 2006 Share Posted September 2, 2006 By: Chris Cureau - ccureau passing $P{} parameters to subreport 2005-08-24 12:00 Hi there! I've got a bit of a problem when trying to pass along parameters to my subreport from the main report. This is what I have: passed to the subreport: optId $F{optId} select $P{select} select is passed as a parameter to the first report, and I need to pass it on to the subreport to use in the query. When I construct the query with only optId, it works fine. When I add the select parameter in as well, jasper reports that there is an error in the sql statement. I've verified that the parameter being passed is correct before being sent to the main report and that the complete query works fine in mysql's query browser. The query looks something like this: select a.field1, a.field2, b.field3 from table1 a, table2 b where a.field1=$P{optId} and a.field1=b.field1 $P{select} Any ideas why this wouldn't work? Link to comment Share on other sites More sharing options...
marianela Posted March 22, 2007 Share Posted March 22, 2007 Hi, Sorry to bother you, but I'm facing the same problem...Could you please tell me if you solved it?? Thanks a lot, i really appreciate your attention... Regards,Marianela;) Link to comment Share on other sites More sharing options...
jmurray Posted March 22, 2007 Share Posted March 22, 2007 When naming your fields, variables, and parameters you need to avoid using reserved words. The original post had $P{SELECT}, and SELECT is a reserved word in SQL. Maybe you are suffering the same problem because your parameter name is based on some reserved word that is interpreted in a manner that creates an error. Link to comment Share on other sites More sharing options...
marianela Posted March 22, 2007 Share Posted March 22, 2007 My problem was actually in my query, I was passing the parameters correctly. Well I fix my problem...Thanks a lot¡¡¡ Regards,Marianela;) 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