【问题标题】:Dynamic Parameters Passing into the Report through Postgresql通过 Postgresql 传入报表的动态参数
【发布时间】:2014-05-04 01:18:02
【问题描述】:

我正在开发 Ireport 4.0.1 版本。 我的要求是将参数动态传递给报告,我的报告包含两个参数,如 product_category 和 product_id。如果我为 product_category 参数选择值并且没有为 product_id 选择值,则报告应提供在 product_category 上过滤的数据,否则,如果我同时提供这两个值,则对这两个值进行过滤。我怎样才能通过 Ireports 实现。请任何人都可以帮助我。

提前致谢 斯瓦蒂。

【问题讨论】:

标签: ireport


【解决方案1】:

您可以使用可选的 where 子句条件,使参数可选试试这个:-

 WHERE  product_id= $P{product_id} or $P{product_id} is null
  AND   product_category= $P{product_category} or $P{product_category} is null

如果参数是Collection类型那么你不需要这个条件。

如需更多帮助,您可以参考Link

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多