示例说明
在组合分析中获取表中的内容生成动态标题,并给动态标题写样式,如下图:
设置方法
宏类型
类型 | 对象 | 事件 |
ClientSide | simpleReport | onRenderTable |
宏代码
function main(simpleReport, simpleReportContext) { var tailHTML; var c1 = simpleReport.grid.getCell(1, 1); var c2 = simpleReport.grid.getCell(1, 2); var c3 = simpleReport.grid.getCell(1, 3); 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); } |
关键对象总结