rida_10 Posted April 1, 2011 Share Posted April 1, 2011 Hello Every One, as a matter of fact, i have a parameter that shouled be processed first then used in my query,so i created the first parameter as $P{RAW_PARAM},then i created second parameter $P{PARSED_PARAM} that has an expression like this pattern:$V{MY_VARIABLE}.process( $P{RAW_PARAM} ) where function process returns the result that should be used in my queryand where variable MY_VARIABLE is an instance of a userdefined class .all this introduction to say that i am printing $P{PARSED_PARAM} and the result is null why ?although i have created a text field and gave it same expression as in the $P{PARSED_PARAM} and it give the expected resultand that is why i didn't post my codeso can a parameter use a variable Link to comment Share on other sites More sharing options...
braxivamov Posted April 1, 2011 Share Posted April 1, 2011 Hi, i'm not 100% sure but i think no =)For me the elements of the report are generated from top to bottom of your left panel ( styles are created, then parameters, then fields, then variable, ...) so when it comes to diplay your field in a band it 's ok but as the variable are calculated after the params and fields it cannot work in your queryLet me know if i understand well your question or if what i m saying if wrongRegards Link to comment Share on other sites More sharing options...
despec Posted April 1, 2011 Share Posted April 1, 2011 Well, I believe that variables are processed during the query execution, while parameters are set prior to the query being executed. Not sure if I'm understanding your question correctly, but I don't believe what you're trying to do is going to work out. David Link to comment Share on other sites More sharing options...
rida_10 Posted April 4, 2011 Author Share Posted April 4, 2011 ok braxivamov, first good morning,yes, i think that u are targeting my question, but i want to ask how to process a given parameter before submitting it to the query especiallay if my processing contains a loop, in other words i want to transform thecomming parameter having this pattern: (abc:1, def:23, ghi:359, xyz: 39....) {a multi-select combo box value} TO this pattern :WHERE (TreeId = abc AND NodeId = 1) OR (TreeId =def AND NodeId = 23 ) OR (TreeId =def AND NodeId = 23 ) OR (TreeId =ghi AND NodeId = 359 ) OR (TreeId =ghi AND NodeId = 359 ) OR (TreeId =xyz AND NodeId = 39 ) OR ...... Link to comment Share on other sites More sharing options...
rida_10 Posted April 4, 2011 Author Share Posted April 4, 2011 Same question for David, and thanks for replies Link to comment Share on other sites More sharing options...
mdahlman Posted April 4, 2011 Share Posted April 4, 2011 You cannot use variables there. You should have no need to.Instead do something like this for PARSED_PARAM:MyClass.process( $P{RAW_PARAM} )Regards,Matt Link to comment Share on other sites More sharing options...
rida_10 Posted April 5, 2011 Author Share Posted April 5, 2011 Good Morning,thanks Matt. it works as u adviced,and thanks to internet to comunicate with developersGood Luck Rida 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