页面树结构

版本比较

标识

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

...

以下宏在IE,google,火狐浏览器下测试基本上都可以正常使用

2.1 电子表格宏

 非照相机功能制作的报表,使用宏如下:

类型:ClientSide(客户端宏)   对象:spreadsheetReport    事件:onRender

代码块
linenumberstrue
collapsetrue
function main(spreadsheetReport) {
    var doc = spreadsheetReport.elemSheetFrame.contentWindow.document;
    doc.documentElement.oncontextmenu = doc.body.oncontextmenu = function() {
        return false; //禁止鼠标右键
    };
    doc.onkeydown = function(e) {
        var ev = e || window.event;
        if (ev && ev.ctrlKey && ev.keyCode == 67) { // Ctrl + C
            return false;
        }
    };
    doc.ondragstart = function() {
        return false; //禁止拖拽
    };
}

使用照相机功能实现的报表,使用宏如下:

类型:ClientSide(客户端宏)   对象:spreadsheetReport    事件:onRender

 

代码块
function main(spreadsheetReport) {
    preventContextMenu(spreadsheetReport.elemSheetFrame);
}
function preventContextMenu(iframe) {
    var doc = iframe.contentWindow.document;
    var list = doc.getElementsByTagName("IFRAME");
    for (var i = 0; i < list.length; i++) {
        function x(subIFrame) {
            preventContextMenu(subIFrame);
            subIFrame.onload = function() {
                preventContextMenu(subIFrame);
            }
        };
        x(list[i]);
    }
    doc.documentElement.oncontextmenu = doc.body.oncontextmenu = function() {
        return false; //禁止鼠标右键
    };
    doc.onkeydown = function(e) {
        var ev = e || window.event;
        if (ev && ev.ctrlKey && ev.keyCode == 67) { // Ctrl + C
            return false;
        }
    };
    doc.ondragstart = function() {
        return false; //禁止拖拽
    };
}

 

2.2 灵活分析宏

类型:ClientSide(客户端宏)   对象:simpleReport    事件:onRender

...