页面树结构

版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。
评论: 支持清单报表

...

3、在报表宏界面新建服务端模块。在弹出的新建模块对话框中,选择对象为spreadsheetReport、事件为onBeforeOutput、并把下面宏代码复制到代码编辑区域。

Image RemovedImage Added

宏类型

类型

对象

事件

服务端宏

spreadsheetReportonBeforeOutput
代码块
linenumberstrue
function main(spreadsheetReport) {
    if (spreadsheetReport.outputType !== "EXCEL2007" || spreadsheetReport.outputType == "LIST_EXCEL") return; {
        spreadsheetReport.cacheable = false;
        var workbook = spreadsheetReport.workbook;
        var worksheets = workbook.worksheets;
        for (var i = 0; i < worksheets.count; i++) {
            var worksheet = worksheets.get(i);
            var cells = worksheet.cells;
            var maxDisplayRange = cells.maxDisplayRange;
            for (var x = 0; x < maxDisplayRange.rowCount; x++) {
                for (var y = 0; y < maxDisplayRange.columnCount; y++) {
                    var cell = cells.get(x, y);
                    if (cell.isFormula()) {
                        cell.value = cell.value;
                    }
                }
            }
        }
    }
}

相关资源:migrate (12).xml

...