注意 | ||
---|---|---|
| ||
本文档的示例代码仅适用于本文档中的示例报表/场景。若实际报表/场景与示例代码无法完全适配(如使用功能不一致,或多个宏代码冲突等),需根据实际需求开发代码。 |
示例说明
在组合分析的导出按钮中,提供多个导出选项,如HTML、EXCEL、CVS等。有时候希望只保留某一些选项,可通过宏代码控制实现。
...
类型 | 对象 | 事件 |
---|---|---|
ClientSide | simpleReport | onRender |
宏代码
...
代码块 | ||
---|---|---|
| ||
function main(simpleReport, simpleReportContext) { if(!simpleReport._initExportMenu_new){ simpleReport._initExportMenu_new = simpleReport.initExportMenu; simpleReport.initExportMenu = function() {debugger; // debugger; simpleReport._initExportMenu_new(); this.exportMenu.removeItem("TXT"); //屏蔽CSV this.exportMenu.removeItem("CSV"); //屏蔽CSV this.exportMenu.removeItem("MHT"); //屏蔽HTML this.exportMenu.removeItem("PNG"); //屏蔽PNG this.exportMenu.removeItem("PDF"); //屏蔽PDF this.exportMenu.removeItem("WORD"); //屏蔽WORD var t = this; setTimeout(function() { // 异步插入到最后的也要异步删除 t.exportMenu.removeItem('DATAPACKAGE'); }, 0); } } //debugger; if(!simpleReport.old_doExport){ simpleReport.old_doExport = simpleReport.doExport; simpleReport.doExport = function(ev) {debugger; this.old_doExport(ev); debugger; this.exportMenu.panel.style.height = ""; //上面是高度自适应 } } |
...
}
} |