示例
灵活分析表头所有文字显示都加粗显示
实现步骤
- 在展现定制中,创建一张灵活分析
- 切换到 "定制->宏管理"界面,双击此灵活分析进入报表宏界面。
- 在报表界面新建客户端模块,在弹出的新建模块对话框中选择对象为simpleReport;事件为onRender;并把下面宏代码复制到代码区域
宏类型
类型 | 对象 | 事件 |
ClientSide | simpleReport | OnRender |
宏代码
function main(simpleReport, simpleReportContext) { var grid = simpleReport.grid; for (var row = 0, len = grid.getHeaderRows(); row < len; ++row) { for (var col = 0, leng = grid.getColCount(); col < leng; ++col) { var cell = grid.getCell(row, col); if (cell) { cell.style.fontWeight = '800'; if (cell.firstChild) { cell.firstChild.style.fontWeight = '800'; } } } } }
4. 在报表界面新建客户端模块,在弹出的新建模块对话框中选择对象为simpleReport;事件为onRenderTable;并把下面宏代码复制到代码区域
宏类型
类型 | 对象 | 事件 |
ClientSide | simpleReport | OnRenderTable |
宏代码
function main(simpleReport, simpleReportContext) { var grid = simpleReport.grid; for (var row = 0, len = grid.getHeaderRows(); row < len; ++row) { for (var col = 0, leng = grid.getColCount(); col < leng; ++col) { var cell = grid.getCell(row, col); if (cell) { cell.style.fontWeight = '800'; if (cell.firstChild) { cell.firstChild.style.fontWeight = '800'; } } } } }