做了一个报表,在预览的时候,没有任何问题,放到报表服务器在软件中使用时出现一个奇怪的问题。
61333
1.不选任何筛选条件,正常运行
2.各个筛选条件组合使用也没问题
3.唯独只选择对照类型的时候,会不出现这个错误,如果选了这个筛选条件,在选一个其他的条件就能正常运行。
下面是报表的SQL语句,有问题的筛选条件是d_code:
http://bbs.fanruan.com/static/image/hrline/1.gif报表查询语句
select a.goods_code,a.goods_name,a.goods_spec,a.goods_models,a.goods_unit_purchase_price,a.goods_unit_retail_price,a.goods_clinic_type_code,b.goods_clinic_type_name,
case when a.clinic_use_flag=1 then '可收费'
else '不可收费'
end
from dms.goods_basic_info a
left join dms.goods_clinic_type_dict b
on a.goods_clinic_type_code=b.id
left join (select e.goods_code,
case when e.goods_clinic_type_code is null then '未对照'
else '已对照' end
as d_flag
from dms.goods_basic_info e ) f on f.goods_code=a.goods_code
where a.goods_cate_code='01'
and a.goods_class not in ('1201','1308','1501')
${if(len(d_code) == 0,"","and f.d_flag='" +d_code+ "'")}
${if(len(goods_name) == 0,"","and a.goods_name like '%" +goods_name+ "%'")}
${if(len(c_code) == 0,"","and a.goods_clinic_type_code = '" + c_code+ "'")}
http://bbs.fanruan.com/static/image/hrline/1.gifd_code的查询语句
select distinct
case when e.goods_clinic_type_code is null then '0'
else '1' end
as d_flag,
case when e.goods_clinic_type_code is null then '未对照'
else '已对照' end
as d_name
from dms.goods_basic_info e