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)
Dynamic library or dynamic dataset
xpaterna
Hi!
I've been searching for a solution of my problem for two days but I can't find anything. So here is it:
I have two rptlibraries with datasets that connects to the same DataSource and with the exactly same names.
I have a rptdesign with some tables and charts, what I need is to swap library (or the datasets) depending on a parameter. Example:
- rptLibrary1 have the dataset1 called "myDataset"
- rptLibrary2 have the dataset2 called "myDataset"
In my rptdesign there are some tables and charts, for example the chart Chart1, and a boolean report parameter called param1 (I'm inspired with the names).
If param1 is true, I want to use "myDataset" from rptLibrary1 on the Chart1 (and on every table of the report).
If param1 is false, I want to use "myDataset" from rptLibrary2 on the Chart1 (and on every table of the report).
Is there any way to achieve this? If not, is there any way to achieve putting the two datasets in the same library (with different names) and swapping from one to other?
I've seen that you can change the dataset of a table in the BeforeFactory script of a table and changing the "dataSet" property of the element, but I want to change the dataset for all the report, not only in one element.
Thank you very much.
Find more posts tagged with
Comments
kclark
What do the tables in each dataset look like? I'm wondering if joining the two datasets would work better for your situation. Can you describe the datasets for me?
xpaterna
Hi kclark,
The queries of the two datasets are very different but both have the same output columns, so joining the two datasets in one with a combined query I think is very difficult.
The problem is that I need two identical reports (the same rptdesign) but with different results on tables and charts.
I know that I can have two identical rptdesign, one using the first library and the other one using the second library, but I'm searching a solution for generate the report with the same rptdesign for maintainability reasons.
Do you know what can I do?
Thank you.
EDIT 12/07/2012:
I've solved my problem. Finally I've only used one library. On every Data Set, i've write the first query normally, and then, in the BeforeOpen script, I've changed the query depending on the parameter.
It works like a charm, the bad thing is that the query on the BeforeOpen script must be in String format, so it's a little ugly to write, but well, is the only solution I've found.
I attach an easy example, look at the BeforeOpen script of the DataSet to see how I change the query.