Birt Report 同一字段的多个参数 [英] Birt Report Multiple Parameters for the same field
问题描述
我正在使用 Birt 生成报告.我想在我的 where 子句中使用相同的参数两次,例如日期列 >= 在哪里?和日期列.这 '?'这一行是一个指向日期的参数(报告参数).在我的下一个 where 子句中添加到这一点,我想使用第二个参数再次查找日期时间段,但在不同的年份(当前年份 -1).我知道 birt 会看到参数和 ?依次.我该如何配置?
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?
推荐答案
只需将两个具有 2 个不同名称的参数添加到您的查询中,并为您的两个参数使用相同的来源(Report-Paramter).没有限制,您不能在查询中多次添加相同的参数.
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.
在您的 SQL 查询中添加尽可能多的 ?
参数:
Add as many ?
in your SQL query as you need 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.):
这篇关于Birt Report 同一字段的多个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!