How to pass parameters to data set behind a data cube in BIRT?

2.3k views Asked by At

I have a data cube which is based on a data set. The data set takes a number of parameters. So far I have not been able to find out how to pass parameters to that data set. I see that it is possible to set a filter on the data cube but that doesn't help me.

How can I pass the necessary parameters to the data set?

1

There are 1 answers

0
AudioBubble On BEST ANSWER

To pass parameters to a relational data source in BIRT:

  • Set up appropriate Report Parameters (via the Data Explorer).
  • Add parameter markers (ie. ?s) to your SQL query where you want to parameterise the query (eg. if you want to select customers by country, change your datasource query to be SELECT * FROM CUSTOMER WHERE COUNTRY = ? ).
  • Add dataset parameters to your dataset (via the Parameters tab of the Edit Data Set dialog) in the order they appear in your SQL query, and specify the corresponding Report Parameter in the Linked to Report Parameter value of the New Parameter dialog. (This is how you manually bind the Report Parameters to the parameters in the query - you will need to set up a dataset parameter for each parameter marker in the SQL query.)

If you now preview the report, it should prompt you for parameter values and then display the report (appropriately filtered).

If you were using a non-relational data source, you would set up a filter at the dataset level instead of parameterising the query - there is an example of this approach here. (You can do this with SQL-based reports too, but it is less efficient than filtering at the query level.)