我想在参数A的默认值写公式,如果GETUSERDEPARTMENTS(2)=景田总部能看所有数据,否则只看本公司下面的数据
${if(a='景田总部',"","and 公司='"+a+"'")}
${if(GETUSERDEPARTMENTS(2)=景田总部) ,"","and 字段 like '%"+GETUSERDEPARTMENTS(2)+"%' "}
----------
if(GETUSERDEPARTMENTS(2)="景田总部" ,nofilter,GETUSERDEPARTMENTS(2) )
${if(GETUSERDEPARTMENTS(2))=='景田总部','',"and factory= GETUSERDEPARTMENTS(1)")}
where 1=1
${if(GETUSERDEPARTMENTS(2)=景田总部,"","and factory = '"+ 参数+"'")}
你在报表上加个a 参数的参数框,控件值内输入公式 =GETUSERDEPARTMENTS(2)