var a=this.options.form.getWidgetByName("year"); var a=a.getValue(); var b=this.options.form.getWidgetByName("year1"); var b=b.getValue(); var c=this.options.form.getWidgetByName("depart_name").getValue(); var bl=c.toString().replace(/,/g,"','");//全局替换。把下拉树的逗号替换成引号 逗号 引号。 var area=FR.remoteEvaluate('sql("cloud","select depart_name as depart_name1 from sys_depart where id in(select parent_id from sys_depart where depart_name in(\''+bl+'\'))",1)') var url = 'report?reportlets=';//定义url var pars = '&format=excel&__filename__=1&depart_name='+c+'&year='+a+'&year1='+b;//设置导出格式和导出文件名称 var path = "weekly_statistics/export_information111.cpt";//获取模板名称和路径 //获取模板中参数值,以数组形式存储,每个参数值对应一个sheet alert(area); var json = []; for (var i = 0; i < area.length; i++) { var sheet = { reportlet: path, depart_name1:area[i] }; json.push(sheet); } alert(json); jsonStr = encodeURIComponent(JSON.stringify(json));//对url进行encodeURIComponent编码 url += jsonStr;//给url添加模板参数 url += pars;//给url添加导出参数 alert(url);//打印url setTimeout(function() { window.open(url); }, 1500); |
最佳回答 |
||||
0
|
|