页面树结构
转至元数据结尾
转至元数据起始

正在查看旧版本。 查看 当前版本.

与当前比较 查看页面历史

版本 1 当前 »

示例说明

    在页面的公共参数后增加 "打开"按钮,点击该按钮,打开其他报表或者页面
    

    点击打开效果
    

设置方法

  1. 在 资源定制 中创建好案例中的页面
  2. 选中页面,右键选择 编辑宏 进入报表宏界面。
  3. 在报表宏界面新建客户端模块。在弹出的新建模块对话框中选择对象为 page,事件为onRenderPage,并把下面的宏代码复制到代码区域

          


宏类型

宏类型

对象

事件

ClientSide

Page

onRenderPage

宏代码

function main(page, pageContext) {
    //在公共参数列表的最后一个单元格后面新增加单元格:lastCell
    page.paramPanel.layoutTable.parentNode.style.display = "";
    var paramTable = page.paramPanel.layoutTable;
    var i, cell, lastCell;
    if (paramTable.rows.length == 0) {
        paramTable.insertRow( - 1);
    }
    for (i = 0; i < paramTable.rows.length; i++) {
        cell = paramTable.rows[i].insertCell( - 1);
        if (i == paramTable.rows.length - 1) lastCell = cell;
    }
    //新建button,并把这个button加到最后一个参数后面
    var btnElem = document.createElement("input");
    btnElem.type = "button";
    btnElem.className = "button-buttonbar-noimage";
    btnElem.value = "打开";
    btnElem.onclick = doSetting;
    if (lastCell) {
        lastCell.appendChild(btnElem);
    }
    function doSetting() {
        var dialogHeight = 600;
        var dialogWidth = 800;
        var features = ['dialogHeight:' + dialogHeight + 'px', 'dialogWidth:' + dialogWidth + 'px', 'height:' + dialogHeight + 'px', 'width:' + dialogWidth + 'px', 'resizable:no;scroll:no;status:no;center:yes;help:no;edge:raised'];
        var left = (screen.width - dialogWidth) / 2;
        var top = (screen.height - dialogHeight - 20) / 2;
        features[features.length] = "dialogLeft:" + left + "px";
        features[features.length] = "dialogTop:" + top + "px";
        features[features.length] = "left:" + left + "px";
        features[features.length] = "top:" + top + "px";
        //features.push('modal:' + (dialogType == 'modal' ? 'yes' : 'no'));
        var sFeatures = features.join(',').replace(/:/g, '=');
        window.open('openresource.jsp?resid=I4028818a53e6b47c014ed76a5bd305d3', '打开', sFeatures); //打开相应的资源,报表或者页面
    }
}



  • 无标签