You can add a (partial) SQL ststement that is contained in a Parameter to your Report Query using the $P!{} notation.
But, if the SQL statement contained in the Parameter itself also contains variables (either in the JR syntax of "$P{}" or in the JDBC syntax of "?"), there is no way to get these variables added in properly.
Only option I see it preparsing the SQL yourself, before supplying it to JR. And parsing all teh variables in, into the string is:
- insecure (SQL injections)
- tricky to get it working cross db
- just something that should be avoinded, as JDBC can do it for us.
Therefor I was thinking int he following direction:
- give the $P!{paramName} syntax an optional second parameter for arguments, so it becomes: $P!{paramName for SQL, paramName for arguments[]}
or:
-Ability to double evaluate: $P!!{}: This way I could preprocess the question marks in my SQL to change them into the $P{} notation that Jasper understands and add all the required parameters to my parameterMap
If I missed something and this is allready possible: please point me in the right direction, because I could not find anythign on this topic.
Paul
I posted this also on the JasperReport forum: http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=33253&catid=8
Recommended Comments
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