页面树结构

版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。


注意
title温馨提示

本文档的示例代码仅适用于本文档中的示例报表/场景。若实际报表/场景与示例代码无法完全适配(如报表使用冻结,或多个宏代码冲突等),需根据实际需求开发代码。

示例说明
在组合分析中获取表中的内容生成动态标题,并给动态标题写样式,如下图:
 
 
 
 
设置方法

...

类型

对象

事件

ClientSide

simpleReport

onRenderTable


宏代码

代码块
languagejs
themeEclipse
languagejs
firstline1
linenumberstrue
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);
}
 
 

...

  • 设置单元格显示值:simpleReport.grid.setCellText(int,int,text)

...