设置查询按钮的js为:
var ptime = this.options.form.getWidgetByName("ptime").getValue();
var pmcode = this.options.form.getWidgetByName("pmcode").getValue();
var porg = this.options.form.getWidgetByName("porg").getValue();
var pperiodls = "";
alert(pperiod);
if(pperiod.length>0 && pperiod!="null"){
pperiodls=" and tableperiod = '"+pperiod+"'";
}else{
pperiodls=" and tableperiod is null";
}
var phuizongls = "";
if(phuizong.length>0 && phuizong!="null"){
phuizongls=" and tablehuizong = '"+phuizong+"'";
}else{
phuizongls=" and tablehuizong is null";}
var sql1='=sql("SQLServer_老报表","select filename from dbo.txt_table where tabletitle=\''+ptitle+'\'and tabletime=\''+ptime+'\' and tablemcode=\''+pmcode+'\' and tableorg=\''+porg+'\' '+pperiodls+phuizongls+'",1,1)'
var file = FR.remoteEvaluate(sql1);
var url = "报表地址/Onbase/servlet/LoadAction?action_name=" + file;
FR.doHyperlinkByPost(url,{place:""},'AA');