页面树结构

版本比较

标识

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

示例说明

在即席查询中获取表中的内容生成动态标题,并给动态标题写样式,如下图:

设置方法

  1. 在“分析展现”节点下,创建一张即席查询。
  2. 选中即席查询,右键选择 编辑宏 进入报表宏界面。
  3. 在报表宏界面新建客户端模块。在弹出的新建模块对话框中选择对象为simpleReport、事件为onRenderTable、并把下面宏代码复制到代码区域;

宏类型

类型

对象

事件

ClientSide

simpleReport

onRenderTable

宏代码

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

关键对象总结

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

资源下载

资源:migrate.xml

面板
borderColor#BBBBBB
bgColor#F0F0F0
borderWidth1
borderStylesolid

目录