Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Switching query based on the role - Again picked from SQL
sadhiesh
Hello,
I get userid as an report input parameter. I need to pull the report data based on the permission applicable to the group to which the user id belongs.
So its as good as running a different query to pull the report data based on the roles permission. How can i design the report dataset to run one of the 3 queries based on the permission of the userid' role which again has to be picked from the DB.
I am using BIRT 2.6.2.
Any help is appreciated.
Thanks,
Sadhiesh
Find more posts tagged with
Comments
mwilliams
If I'm understanding correctly, there are a couple different ways to do this. You could use their userid to query what permission group they're in in one dataSet and put a hidden text box at the top of your design that is bound to this dataSet so that it runs first. In the onFetch of this dataSet, you can grab the permissions group that this userid returns and use this value in your beforeOpen of your other dataSet, which query to run. You can set the query in your beforeOpen with this.queryText = "select * from blah ....";
The other way would be similar, but you'd embed the details dataSet table inside one bound to their permissions dataSet. Then you could grab the value from the outer permissions table to use in your inner dataSet to decide which query to run.
Hope this helps. Let me know if you have questions or need an example.
sadhiesh
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="81866" data-time="1314208968" data-date="24 August 2011 - 11:02 AM"><p>
If I'm understanding correctly, there are a couple different ways to do this. You could use their userid to query what permission group they're in in one dataSet and put a hidden text box at the top of your design that is bound to this dataSet so that it runs first. In the onFetch of this dataSet, you can grab the permissions group that this userid returns and use this value in your beforeOpen of your other dataSet, which query to run. You can set the query in your beforeOpen with this.queryText = "select * from blah ....";<br />
<br />
The other way would be similar, but you'd embed the details dataSet table inside one bound to their permissions dataSet. Then you could grab the value from the outer permissions table to use in your inner dataSet to decide which query to run.<br />
<br />
Hope this helps. Let me know if you have questions or need an example.<br /></p></blockquote>
<br />
<br />
Thanks very much for your response. I will try the option you had suggested as the option 1. Does this implementation will involve using the Property Binding of the dataset by any chance.<br />
<br />
I am a novice to the BIRT reports and exploring them at this time. So please bear with me, if i startle you with my ignorant questions.<br />
<br />
thanks once again.<br />
<br />
Regards,<br />
Sadhiesh
mwilliams
You could use the property binding tab in the dataSet editor, or you could just use the beforeOpen script. Either should work. Let me know if you have questions.