填报报表:为加载结束后事件里的sql加一列就报错,但sql能单独执行,看代码也没有啥问题

报错:SyntaxError: Invalid or unexpected token

代码:

var text = contentPane.curLGP.getCellValue("D3");

//获取D3控件值

if (!text) {

var sql = "select to_char(nvl(anar.in_oproom_date, aly.scheduled_date), 'yyyy-mm-dd') oper_date, to_char(nvl(reg.patient_name, aly.patient_name)) patient_name, nvl(rop.operator_doctor, aop.operator_doctor) operator_doctor, nvl(rop.circuit_nurse,aop.circuit_nurse) circuit_nurse,nvl(rop.scrub_nurse,aop.scrub_nurse) scrub_nurse from sam_apply aly left join sam_reg reg on reg.sam_apply_id = aly.id left join ipi_registration ipi on ipi.id = nvl(reg.ipi_registration_id, aly.ipi_registration_id) left join sam_anar anar on anar.sam_apply_id = aly.id left join (select max(e.employee_name) operator_doctor, max(e2.employee_name) scrub_nurse, max(e3.employee_name) circuit_nurse, op.sam_apply_id from sam_apply_op op left join hrm_employee e on e.id = op.operator_doctor_id left join hrm_employee e2 on e2.id = op.scrub_nurse_01 left join hrm_employee e3 on e3.id = op.circuit_nurse_01 group by op.sam_apply_id) aop on aop.sam_apply_id = aly.id left join (select max(e.employee_name) operator_doctor,  max(e2.employee_name) scrub_nurse, max(e3.employee_name) circuit_nurse, op.sam_reg_id from sam_reg_op op left join hrm_employee e on e.id = op.operator_doctor_id left join hrm_employee e2 on e2.id = op.scrub_nurse_01 left join hrm_employee e3 on e3.id = op.circuit_nurse_01 group by op.sam_reg_id) rop on rop.sam_reg_id = aly.id where ipi.ipi_registration_no like '%" + ipi_no + "%'";

var riqi = FR.remoteEvaluate('=sql("JDBC2","' + sql + '",1,1)');

var xingm = FR.remoteEvaluate('=sql("JDBC2","' + sql + '",2,1)');

var zdys = FR.remoteEvaluate('=sql("JDBC2","' + sql + '",3,1)');

var xhhs = FR.remoteEvaluate('=sql("JDBC2","' + sql + '",4,1)');

var xshs = FR.remoteEvaluate('=sql("JDBC2","' + sql + '",5,1)');

//var zhudaoys=FR.remoteEvaluate("value('ds1','成本价','产品ID','"+id+"')");

//var xunhuihs=FR.remoteEvaluate("value('ds1','单价','产品ID','"+id+"')");

//var xishouhs=FR.remoteEvaluate("value('ds1','库存量','产品ID','"+id+"')");

//根据产品ID去ds1数据集中获取其他字段的值

var row = 2

//获取当前行号

_g().setCellValue(0, 1, row, riqi);

_g().setCellValue(0, 2, row, xingm);

_g().setCellValue(0, 3, row, ipi_no);

_g().setCellValue(0, 6, row, zdys);

_g().setCellValue(0, 7, row, xhhs);

_g().setCellValue(0, 8, row, xshs);

//给当前行其他单元格赋值;

_g().setCellValue('J' + (row+1), null, 1);

//给当前行的L列单元格赋值

}

FineReport 帆软用户frLlnxgPLQ 发布于 2023-3-2 16:28
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
1
用户k6280494Lv6资深互助
发布于2023-3-2 17:07

远程给你看看?

  • 2关注人数
  • 349浏览人数
  • 最后回答于:2023-3-2 17:07
    请选择关闭问题的原因
    确定 取消
    返回顶部