动态传递参数到iReport 4.0.1 [英] Dynamically Passing Parameters to iReport 4.0.1

查看:263
本文介绍了动态传递参数到iReport 4.0.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究iReport 4.0.1版。我的查询是

I'm working on iReport version 4.0.1. My query is

select productcategory as CATEGORYNAME,
    value as VALUE,m_product_id::text,
    product as NAME,count(pricexception) as stock 
from dtawm_stockcalculation_v
where m_product_id=$P{M_Product_ID} or $P{M_Product_ID} is null
    and productcategory=$P{M_Product_Category_ID} 
    or $P{M_Product_Category_ID} is null
group by value,m_product_id,product,productcategory 

我在其中使用两个参数: $ P {M_Product_ID} $ P {M_Product_Category_ID} 。这里我将两个参数的默认值设置为'%'但是我收到错误:

In which I am using two parameters: $P{M_Product_ID} and $P{M_Product_Category_ID}. Here I am setting default value for both parameters as '%' but I get an error:

Cannot cast char to string.


推荐答案

通常我们使用来设置默认值字符串类型参数。

Usually we use " " to set the default value for string type parameter.

这篇关于动态传递参数到iReport 4.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆