Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamic Parameter - Allow Multiple Values
bcs0629
Hey All, my report (2.6.2) has a dynamic parameter that is set to 'Allow Multiple Values', but when I try to select more than one value for my report in BIRT Viewer, I get an error that says Can not load the report query. I can select just one value from the same parameter and it will work fine, but when you try to select multiple values that is when it breaks. Any suggestions? It seems like a pretty straight forward function. I have my report filtered to the value of the parameter.
Thanks,
Bryan
Find more posts tagged with
Comments
CBR
If a parameter has allow multiple values option set it can't no longer beeing used in a query. That's a limitation in BIRT.
You have to build the query using a BIRT script when using these kind of parameters in a query (building database query by a script can introduce security issues...aka SQL injection)
johnw
You need to be real careful when using Multi-Select parameters in a query, like cbrell mentioned. You can use them in a query directly in an event handler and parameter binding using the .toString() method, but you do run the risk of borking the query pretty bad.
If your using stock BIRT, you need to iterate the values of the multi-param result and manually validate and append to your query. Its easier if you use .toString(), as param['myParam'].value returns an object array that tends to be a little cumbersome to work with.
If youre open to using a plugin, I recommend you take a look at the BIRT Functions Lib, available in the BIRT Marketplace and at Google Code (
http://code.google.com/a/eclipselabs.org/p/birt-functions-lib/)
. The Bind Parameters method (
http://code.google.com/a/eclipselabs.org/p/birt-functions-lib/wiki/BindParameters)
will take care of binding and validating multi-select parameters to avoid a potential SQL injection scenario.
bcs0629
Thank you for the tips, I'll be sure to heed yall's advice and move forward.
Bryan