通过灵活分析显示快捷工具栏并添加按钮宏代码添加在灵活分析报表上的快捷工具栏,在打印预览界面会显示出来
可以通过宏代码在打印预览界面将快捷工具栏隐藏
宏类型 | 宏对象 | 宏事件 |
---|---|---|
ClientSide | simpleReport | onRender |
function main(simpleReport, simpleReportContext) { //simpleReport.setShowShotCut(true); //必须重写 simpleReport._szsj_setShowShotCut = simpleReport.setShowShotCut; simpleReport.setShowShotCut = function(flag) { this._szsj_setShowShotCut(flag); if (this.shortcut.style.display == "block") { this.shortcut.style.display = ""; } } hideOnPrint(simpleReport.shortcut); hideOnPrint(simpleReport.navigationLay); //打印隐藏分页 } function hideOnPrint(elem) { if (!elem) return; //不加这一句,通过css覆盖不了内联样式 if (elem.style.display == "block") { elem.style.display = ""; } var hideClass = "print-hidden"; if (!domutils.hasClassName(hideClass)) { domutils.addClassName(elem, hideClass); } } |
资源下载:migrate.xml