在即席查询中获取表中的内容生成动态标题,并给动态标题写样式,如下图:
类型 | 对象 | 事件 |
ClientSide | simpleReport | onRenderTable |
function main(simpleReport, simpleReportContext) { var c1 = simpleReport.grid.getCell(1, 1); var c2 = simpleReport.grid.getCell(1, 2); var c3 = simpleReport.grid.getCell(1, 3); var tailHTML = "<font style='font-weight:bold; font-size:18px; color:#000'>标题宏</font><font style='font-size:12px; color:#000'>产品平均价格为:<font style='font-size:12px; color:#00F'>" + c1.innerHTML + "</font>元,平均数量为:<font style='font-size:12px; color:#FC0'>" + c2.innerHTML + "</font>件,平均折扣为:<font style='font-size:12px; color:#F00'> " + c3.innerHTML + "</font></font>"; simpleReport.setHeader(tailHTML); } |
资源:migrate.xml