比如说现在有数据集里面有A,B,C,D,E,F六个字段,如何通过单选按钮里的1查询A,B,C三个字段,单选按钮里的2则可以查询D,E,F三个字段
都展示出来。然后通过条件属性去隐藏对应的列了
select ${if(单选==1,"a,b,c","d,e,f")} from table
------------
方法2:
SELECT A,B,C FROM TABLE WHERE 1=1 ${IF(单选==1,""," and 1<>1")}
union all
SELECT d,e,f FROM TABLE WHERE 1=1 ${IF(单选==1,"and 1<>1"," ")}
这样实现:
1)在数据字段A-F上方添加辅助行,在A1单元格中存放单选按钮参数choose
2)A-C设置条件属性-列宽,A1!=1时隐藏,同理D-F列设置条件属性-列宽,A1!=2时隐藏
这样就可以了