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)
Show one table depending on user parameter
DMUK
I am looking at a scenario where I want to give the user the option via input parameter, then depending on the result, show them one table, or group of tables, or another.
I am also used to changing the query based on user input, but it is possible to do that with tables etc?
Thanks,
DMUK
Find more posts tagged with
Comments
mwilliams
Hi DMUK,<br />
<br />
You can create all tables, name them, and drop the unnecessary ones based on the parameter:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/1027-drop-a-table-based-on-a-report-parameter/'>Drop
a Table Based on a Report Parameter - Designs & Code - BIRT Exchange</a><br />
<br />
Hope this helps.
DMUK
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>Hi DMUK,<br />
<br />
You can create all tables, name them, and drop the unnecessary ones based on the parameter:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/1027-drop-a-table-based-on-a-report-parameter/'>Drop
a Table Based on a Report Parameter - Designs & Code - BIRT Exchange</a><br />
<br />
Hope this helps.</p></blockquote>
<br />
Perfect, thanks.<br />
<br />
Would it be easy to do the same thing based on the results of a database lookup?<br />
<br />
For example, check database for presence of valuex, if "y", show table 1, else if "z" show table 2?
mwilliams
Hi DMUK,
You could check for a value in your resultSet and change a predefined variable to a certain value for which table to show, I would imagine. this wouldn't be much different than the parameter way I did in the example.
DMUK
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>Hi DMUK,<br />
<br />
You could check for a value in your resultSet and change a predefined variable to a certain value for which table to show, I would imagine. this wouldn't be much different than the parameter way I did in the example.</p></blockquote>
<br />
Thanks - I have this working based on the example checking for user parameters.<br />
<br />
How would I check the a result from a dataset in the beforeFactory? And would the dataset need to be attached to a table or could I create a specific dataset to check for this value?<br />
<br />
Cheers,<br />
<br />
DMUK
mwilliams
DMUK,
You may have to just hide a table if you do it this way. Use the dataSet script to figure out the value, then hide the correct table based on what you find. I'll have to see if there is a way to get the data in time to drop the unneeded table. I'll let you know if I find anything.
DMUK
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>DMUK,<br />
<br />
You may have to just hide a table if you do it this way. Use the dataSet script to figure out the value, then hide the correct table based on what you find. I'll have to see if there is a way to get the data in time to drop the unneeded table. I'll let you know if I find anything.</p></blockquote>
<br />
Thanks.<br />
<br />
The user parameter version would be fine ordinarily, but we have an app setup which auto-PDFs the report when you click on a version which bypasses the user parameters part.