报表数据集有日期、部门、人员、型号、销量几个字段,将日期、部门、人员设置成查询条件,参数sdate、edate、dept、name,日期是必选参数、部门和人员是可选。 想要实现
我用分组汇总做的数据集查询,问题是第一种情况,在设计器数据集查询预览销量列还有数据,但是保存报表网页端预览时销量一列都为空了。按常理来说不应该是显示时间段内按型号汇总销量吗 数据集查询sql: select sdate,edate,xh,sum(num) ${if(len(dept)=0,"",",dept")} ${if(len(name)=0,"",",name")} from salesplan where sdate >= '${sdate}' and edate <= '${edate}' and 1=1 ${if(len(dept) == 0,"","and dept = '" + dept + "'")} ${if(len(name) == 0,"","and name = '" + name + "'")} group by sdate,edate,xh ${if(len(dept)=0,"",",dept")} ${if(len(name)=0,"",",name")} 数据集查询预览:只选择了日期 网页预览:只选择了日期 网页预览:选择了部门 |