Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
624 views
in Technique[技术] by (71.8m points)

eclipse - Birt Report Multiple Parameters for the same field

I am using Birt to generate reports. I want to use the same parameter twice in my where clause e.g. where date_column >= ? and date_column < ?. The '?' at this line is one parameter which points to a date (Report parameter). Adding to this in my next where clause I want to use a second parameter to find the date period again but in a different year (current year -1). I know that birt sees parameters and ? sequentially. How can I configure this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Simply add two parameters with 2 diffenrent names to your query and use the same source(Report-Paramter) for both of your parameters. There is no restriction, that you cannot add the same paramter multiple times to your query.

Add as many ? in your SQL query as you need parameters:

SQL query with parameters

In the Parameters Tag you can link them to your Report-Input-Parameters as you like and also add a Input-Parameter twice. The ? in your query will be replaces by the values of your parameters in the order of appereance (first ? = first parameter, second ? = second parameter etc.):

add parameters to sql query


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...