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)
Read configuration from database
andywhippe
Hi All,
I'm fairly new to birt and have trawled these forums looking for my answer but haven't had much luck.
What I'm trying to do is read a set of parameters from a configuration table in my database and apply these to the report layout. For instance one client may need to see a specific piece of data which another client doesn't and this would all be controlled by the clients config.
At the moment I have these paramaters hard coded into the report as blnShowData = true. How do I read blnShowData from my configuration table in my database and set the value for the report to use? The report is already coded to use blnShowData, it would just need to be set before the report layout begins.
Any help would be much appreciated.
Thanks
Andy
Find more posts tagged with
Comments
Chintan
Hello Andy,<br />
<br />
May you will get your value in database by adding two columns in the database.<br />
and its value will be like<br />
<span class='bbc_underline'>blnShowData</span> <span class='bbc_underline'>value</span><br />
<br />
blnShowData TRUE<br />
blnShowData FALSE<br />
blnShowData TRUE<br />
<br />
and fetch the value from database like<br />
reportContext.setPersistentGlobalVariable(row["key"].toString(),row["value"]);<br />
<br />
You will get dynamic result for client choice.<br />
<br />
Hope this may help you.<br />
<br />
Regards<br />
Chintan
andywhippe
Hi,
Thanks for the reply. That looks promising.
I have already setup a dataset to get the values from my database which works correctly, my issue is applying those values to the report before it gets generated.
How would I have this run before the report is generated? I've read about putting code into the beforeFactory section but I'm not really sure what I'm doing.
Thanks
Andy
Chintan
Hello Andy,
Here i attached an example.
May it helpful you to fetch the values.
Note : In the given example you have to change the path in xml file for csv file.
Regards
Chintan
andywhippe
Chintan,
Thanks very much for your help. Very appreciated! I'll take a look at that and hopefully solve my issue. ^_^
Andy