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)
Two questions regarding parameters for a report
bzarnett
I have two questions for reports and was curious what would be the most appropriate methods of handling it.
1) A user can select zero or more organizations from a list of organizations. How should I include this variable sized list in the "IN" clause or allow for all organizations if nothing is selected.
2) How to include optional parameters to filter a query. For example, a user can filter a report (optionally) by selecting a date range where the appropriate records are associated to. I assume this type of filter would be in the report versus the query and be applied to the data set after it has been executed.
Thanks for any thoughts.
Bryan
Find more posts tagged with
Comments
bhanley
Hi,<br />
<br />
1) The use of the IN operator in a query is not currently supported. in the general data set editor. There are work-arounds to this. Check out this sample from the DevShare to get things working for you. <a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/771-using-a-multivalue-parameter-in-a-in-clause/#description'>Using
a Multivalue parameter in a in clause - Designs & Code - BIRT Exchange</a><br />
<br />
2) If your parameters are optional, the best way to process them is a filter on the Data Set. There is a "Filters" tab on the Data Set editor where you can set them up. When you set up a filter you can build an epxression that can test the value. If no filter value is supplied, you can choose to simply not filter, making the parameter optional by definition.<br />
<br />
Hope this helps.
rpolunsky
Depending on your performance needs, you might want to handle the optional parameters in the beforeOpen event of your dataset. That allows you to modify the actual SQL query and pass the filtering back to the server rather than performing it on the client.
bzarnett
Thanks for the information. Greatly appreciated.