2 ronaldozh RonaldoZH 于 2015.07.21 17:44 提问

求大神帮忙!Birt页面传值,用property binding接不到值..
Query Text:

var query="select n.xh,n.sycj,n.sjcj,n.bscj,n.qzcj,n.qmqcj,n.llzcj,m.xm,m.kccj,m.djm,m.zcj,m.jdcj,m.kssj,m.xdfsmc,m.bkfssm,m.wtgyysm,m.bjh,m.bm,m.lrztsm,m.xsh,m.bz,m.order1,m.order2 from "+

"(SELECT xh,"+
" case when sycj<0 then (select djm from code_cjdj b where sycj=b.djcj) "+
" else to_char(sycj) end sycj,"+
" case when sjcj<0 then (select djm from code_cjdj b where sjcj=b.djcj) "+
" else to_char(sjcj) end sjcj,"+
" case when bscj<0 then (select djm from code_cjdj b where bscj=b.djcj) "+
" else to_char(bscj) end bscj,"+
" case when qzcj<0 then (select djm from code_cjdj b where qzcj=b.djcj) "+
" else to_char(qzcj) end qzcj,"+
" case when qmqcj<0 then (select djm from code_cjdj b where qmqcj=b.djcj) "+
" else to_char(qmqcj) end qmqcj,"+
" case when llzcj<0 then (select djm from code_cjdj b where llzcj=b.djcj) "+
" else to_char(llzcj) end llzcj "+
"from (select (select a.zcj "+
" from cj_lrcjmxb a "+
" where a.zxjxjhh = t.zxjxjhh and a.kch = t.kch and "+
" a.xh = t.xh and a.kxh = t.kxh and a.kssj = t.kssj and "+
" a.cjfldm = '002') as sycj, "+
"(select a.zcj "+
" from cj_lrcjmxb a "+
" where a.zxjxjhh = t.zxjxjhh and a.kch = t.kch and "+
" a.xh = t.xh and a.kxh = t.kxh and a.kssj = t.kssj and "+
" a.cjfldm = '003') as sjcj, "+
"t.bscj, "+
"t.qzcj, "+
"t.qmqcj, "+
"t.xh, "+
"t.zcj as llzcj "+
"from cj_lrcjmxb t where ";

var zxjxjhh=params["zxjxjhh"].value;
var kch=params["kch"].value;
var kxh= params["kxh"].value;
var kssj=params["kssj"].value;
var xsh= params["xsh"].value;
var bjh= params["bjh"].value;

if(kssj != null){

query += " t.zxjxjhh ='" + zxjxjhh + "' and t.kch = '"+kch+"' and t.kxh ='"+kxh+"' and t.kssj like '%"+kssj+"%' and t.cjfldm = '001'))n,";

} else{
query += " t.zxjxjhh ='" + zxjxjhh + "' and t.kch = '"+kch+"' and t.kxh ='"+kxh+"' and t.cjfldm = '001'))n,";

}

query+="(SELECT cj_lrcjb.xh,xs_xjb.xm,kccj,code_cjdj.djm,decode(cjlrfsdm,'001',to_char(kccj),'002',djm) zcj,cj_lrcjb.jdcj,cj_lrcjb.kssj,code_xdfsb.xdfsmc,code_bkfsb.bkfssm,code_wtgyyb.wtgyysm,xs_xjb.bjh,code_bjb.bm,cj_lrztb.lrztsm, xs_xjb.xsh,cj_lrcjb.bz,xs_xjb.xsh||xs_xjb.zyh||xs_xjb.bjh||xs_xjb.xh as order1,xs_xjb.xh as order2 from cj_lrcjb,xs_xjb,code_cjdj,code_xdfsb,code_bkfsb,code_wtgyyb,code_bjb,cj_lrztb "+
"WHERE cj_lrcjb.xh = xs_xjb.xh(+) and cj_lrcjb.lrztdm = cj_lrztb.lrztdm(+) and cj_lrcjb.djcj = code_cjdj.djcj(+) and cj_lrcjb.xdfsdm = code_xdfsb.xdfsdm(+) and xs_xjb.bjh=code_bjb.bjh(+) "+
"and cj_lrcjb.bkfsdm = code_bkfsb.bkfsdm(+) and cj_lrcjb.wtgyydm = code_wtgyyb.wtgyydm(+) and cj_lrcjb.zxjxjhh ='" + zxjxjhh + "' and cj_lrcjb.kch = '"+kch+"' and cj_lrcjb.kxh ='"+kxh+"'";

if(kssj!=null){
query += " and cj_lrcjb.kssj like '%"+kssj+"%'";
}
if(xsh!=null){
query += " and xs_xjb.xsh like '%"+xsh+"%'";
}

if(bjh!=null){
query += " and xs_xjb.bjh like '%"+bjh+"%'";
}
query += " order by xs_xjb.xsh,xs_xjb.zyh,xs_xjb.bjh,xs_xjb.xh )m where n.xh=m.xh";

this.text = query;

页面:

"/frameset?__report=reports/new_report_1.rptdesign&__format=HTML&zxjxjhh=2008-2009-1-1&kch=3720006&kxh=01"
但是打印出来的sql zxjxjhh,kch,kxh全是null

Csdn user default icon
上传中...
上传图片
插入图片