Ariel T
Ariel T

Reputation: 2957

Multiple data set parameters, using each more than once - birt

Is it possible to link more than one Report parameter to data set parameters, when defining a dataset in birt?

To clarify, I want to use 3 parameters in more than one location in the query. If I could use $1 (for example) to specify to use the first one it would be very helpful.

When linking one paraemeter, I can then use '?' in the query to replace it. But What if I have more than one parameter? (e.g. http://wiki.eclipse.org/Link_a_Dynamic_Report_parameter_to_a_Data_Set_parameter_(BIRT) )

Thanks

Upvotes: 0

Views: 1359

Answers (2)

Henning
Henning

Reputation: 836

with params as (
  select ? as year,
         ? as month,
         ? as day
  from dual
)
select ...
from my_table, params p
where my_table.year = p.year
  and my_table.month = p.month
  and my_table.day = p.day
...

Note you can use p as often as you want.

Upvotes: 2

linxuser
linxuser

Reputation: 56

I think I understand your question that you would like to use more than one parameter in the query. This can be done by linking report parameters to data set parameters in the edit data set dialog in BIRT. The query will have something similar to below:

where month = ? and year = ? or month = ?

The parameters are linked according to left-to-right position and is set in the parameter section of the edit data set dialog with the up/down buttons. Sorry, I can't post an image as I am a new user or I would have included a small screenshot of the edit data set dialog. Just right-click on your data set and choose "Edit", then look for the parameters section. The parameters need to be arranged so that they are in the desired order.

I hope this is the answer you were looking for.

Upvotes: 1

Related Questions