Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 305245 - Conditional execution of a dataset
Summary: Conditional execution of a dataset
Status: RESOLVED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Birt-ReportEngine-inbox@eclipse.org CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-09 16:32 EST by Ciro Vladimir CLA
Modified: 2010-05-13 09:29 EDT (History)
2 users (show)

See Also:


Attachments
Sample of switching the dataset through script (46.64 KB, application/octet-stream)
2010-05-12 23:49 EDT, Wei Yan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ciro Vladimir CLA 2010-03-09 16:32:56 EST
Build Identifier: 20090920-1017

I would like to be able to conditionally set if a dataset is run.
Suppose I have 3 data sources and 3 datasets for each one of them. I'd like to display only the datasets related to one data source based on a parameter. This could be done with visibility condition but the datasets that are not visible STILL are executed. Thanks!

Reproducible: Always

Steps to Reproduce:
1. Create a new report.
2. Create 2 or more datasources
3. Create at least one dataset per datasource.
4. Add distinct datasets to report as tables.
5. Conditionally "hide" tables based on parameters.
6. Even though tables are hidden, the datasets are still executed
Comment 1 Ciro Vladimir CLA 2010-03-09 16:39:35 EST
this could solve this issue too
http://www.birt-exchange.org/forum/designing-birt-reports/12899-compute-sums-grid-2.html#post60283
Comment 2 Zhiqiang Qian CLA 2010-05-04 01:36:29 EDT
This depends on how engine execute the invisible report items.
Comment 3 Wei Yan CLA 2010-05-12 02:17:13 EDT
actually you can change the report design handle in the onPrepare script.
Comment 4 Ciro Vladimir CLA 2010-05-12 11:47:35 EDT
(In reply to comment #3)
> actually you can change the report design handle in the onPrepare script.

how so?
Comment 5 Wei Yan CLA 2010-05-12 23:49:42 EDT
Created attachment 168316 [details]
Sample of switching the dataset through script

In the design, there are two data set: dataSet_A and dataSet_B. Data Set A queries all the employees with job title as "Sales Rep". Data Set B queries the employees which jot title is not "Sales Rep".

There is also a boolean parameter "IsSalesRep". If this parameter value is TRUE, the report design uses the DataSet_A, if it is false the design uses the DataSet_B.
Comment 6 Ciro Vladimir CLA 2010-05-13 09:29:10 EDT
just what I was looking for.... 

Thankyou very much!