sdemills Posted November 22, 2008 Share Posted November 22, 2008 I'm a relative beginner with iReport. I've built a report with Parameters and they all work ok apart from the one in the ORDER BY clause which reads ORDER BY $P{pSequence} DESC, and more keys.If I include the parameter in the report body then I can see that it is being set correctly.If I edit its value into the SQL statement instead of using the Parameter substitution above, then I get the right results.However if I use the substitution above then the sequence does not come out as desired. I can't tell yet whether that part of the ORDER BY is being ignored or whether the entire ORDER BY clause is being ignored. No error is reported and the report is generated ok but not in the desired sequence.So given that the substitution is working in the report itself - I see the value printed out - and given that parameters used in the WHERE clause are working fine, why doesn't the parameter in the ORDER BY clause work?Any ideas? Or worked examples where it does work?Kind RegardsSteve Link to comment Share on other sites More sharing options...
Gaby38 Posted November 22, 2008 Share Posted November 22, 2008 I don't know what is the exact content of your "$P{pSequence} but if there are strings, I fear that the expansion which takes care of type adds some quots.Try using "$P!{pSequence} (notice the "!")which will expand the parameter as is.Hope this helps Link to comment Share on other sites More sharing options...
sdemills Posted November 23, 2008 Author Share Posted November 23, 2008 That solved it. Thank you very much for the tip. I was just on the point of getting my calling Java program to read back the jrxml file and edit the query on the fly. That was a really useful tip and I've written it down for future reference. Kind Regards Steve Link to comment Share on other sites More sharing options...
pandemic30 Posted May 2, 2014 Share Posted May 2, 2014 Same issue as OP, this solved it, thanks! Link to comment Share on other sites More sharing options...
tekhne Posted May 17, 2022 Share Posted May 17, 2022 A mi me funciono como: $P!{pSequence} 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