我做了一个多参数联动的报表,如下图: file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ksohtml\wpsB5.tmp.jpg 报表的数据集这样的: SELECT * FROM 车型配置 where 1=1 ${if(len(整车SAP号)==0,"","and 整车SAP号='"+ 整车SAP号 +"'")} ${if(len(车型系列)==0,"","and 车型系列='"+ 车型系列 +"'")} ${if(len(车辆型号)==0,"","and 车辆型号='"+ 车辆型号 +"'")} ${if(len(车架)==0,"","and 车架='"+ 车架 +"'")} ${if(len(发动机)==0,"","and 发动机='"+ 发动机 +"'")} ${if(len(变速箱)==0,"","and 变速箱='"+ 变速箱 +"'")} ${if(len(驾驶室)==0,"","and 驾驶室='"+ 驾驶室 +"'")} 其他各个参数的数据集分别是这样的: select 变速箱 FROM 车型配置 where 1=1 ${if(len(车型系列)==0,"","and 车型系列='"+ 车型系列 +"'")} ${if(len(车辆型号)==0,"","and 车辆型号='"+ 车辆型号 +"'")} ${if(len(车架)==0,"","and 车架='"+ 车架 +"'")} ${if(len(发动机)==0,"","and 发动机='"+ 发动机 +"'")} ${if(len(驾驶室)==0,"","and 驾驶室='"+ 驾驶室 +"'")} ${if(len(整车SAP号)==0,"","and 整车SAP号='"+ 整车SAP号 +"'")} ----------------- select 车架 FROM 车型配置 where 1=1 ${if(len(车型系列)==0,"","and 车型系列='"+ 车型系列 +"'")} ${if(len(车辆型号)==0,"","and 车辆型号='"+ 车辆型号 +"'")} ${if(len(变速箱)==0,"","and 变速箱='"+ 变速箱 +"'")} ${if(len(发动机)==0,"","and 发动机='"+ 发动机 +"'")} ${if(len(驾驶室)==0,"","and 驾驶室='"+ 驾驶室 +"'")} ${if(len(整车SAP号)==0,"","and 整车SAP号='"+ 整车SAP号 +"'")} ------------------------------- select 车辆型号 FROM 车型配置 where 1=1 ${if(len(车型系列)==0,"","and 车型系列='"+ 车型系列 +"'")} ${if(len(车架)==0,"","and 车架='"+ 车架 +"'")} ${if(len(变速箱)==0,"","and 变速箱='"+ 变速箱 +"'")} ${if(len(发动机)==0,"","and 发动机='"+ 发动机 +"'")} ${if(len(驾驶室)==0,"","and 驾驶室='"+ 驾驶室 +"'")} ${if(len(整车SAP号)==0,"","and 整车SAP号='"+ 整车SAP号 +"'")} ----------------------------- select 车型系列 FROM 车型配置 where 1=1 ${if(len(车架)==0,"","and 车架='"+ 车架 +"'")} ${if(len(车辆型号)==0,"","and 车辆型号='"+ 车辆型号 +"'")} ${if(len(变速箱)==0,"","and 变速箱='"+ 变速箱 +"'")} ${if(len(发动机)==0,"","and 发动机='"+ 发动机 +"'")} ${if(len(驾驶室)==0,"","and 驾驶室='"+ 驾驶室 +"'")} ${if(len(整车SAP号)==0,"","and 整车SAP号='"+ 整车SAP号 +"'")} ------------------------------ select 发动机 FROM 车型配置 where 1=1 ${if(len(车型系列)==0,"","and 车型系列='"+ 车型系列 +"'")} ${if(len(车辆型号)==0,"","and 车辆型号='"+ 车辆型号 +"'")} ${if(len(变速箱)==0,"","and 变速箱='"+ 变速箱 +"'")} ${if(len(车架)==0,"","and 车架='"+ 车架 +"'")} ${if(len(驾驶室)==0,"","and 驾驶室='"+ 驾驶室 +"'")} ${if(len(整车SAP号)==0,"","and 整车SAP号='"+ 整车SAP号 +"'")} ------------------------------------- select 驾驶室 FROM 车型配置 where 1=1 ${if(len(车型系列)==0,"","and 车型系列='"+ 车型系列 +"'")} ${if(len(车辆型号)==0,"","and 车辆型号='"+ 车辆型号 +"'")} ${if(len(变速箱)==0,"","and 变速箱='"+ 变速箱 +"'")} ${if(len(发动机)==0,"","and 发动机='"+ 发动机 +"'")} ${if(len(车架)==0,"","and 车架='"+ 车架 +"'")} ${if(len(整车SAP号)==0,"","and 整车SAP号='"+ 整车SAP号 +"'")} -------------------------------- select 整车SAP号 FROM 车型配置 where 1=1 ${if(len(车型系列)==0,"","and 车型系列='"+ 车型系列 +"'")} ${if(len(车辆型号)==0,"","and 车辆型号='"+ 车辆型号 +"'")} ${if(len(变速箱)==0,"","and 变速箱='"+ 变速箱 +"'")} ${if(len(发动机)==0,"","and 发动机='"+ 发动机 +"'")} ${if(len(车架)==0,"","and 车架='"+ 车架 +"'")} ${if(len(驾驶室)==0,"","and 驾驶室='"+ 驾驶室 +"'")} 现在的问题是选择后一个参数,前一个参数就消失了,不能实现同时多参数查询,是什么原因?上面的数据集有没有错误? 编辑于 2018-7-19 19:28 |
最佳回答 |
||||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|