按钮,添加事件,打开一个新的填报页面并传递参数

添加一个按钮,按钮上添加js事件,实现打开一个新的填报页面,并且能传递参数

FineReport zxj714905510 发布于 2021-11-26 11:25
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共5回答
最佳回答
0
快乐星光Lv5中级互助
发布于2021-11-26 13:34

var cptpath="测试/填报_项目设备明细.cpt";   //子报表路径

var url = FR.cjkEncode("${servletURL}?reportlet="+cptpath+"&op=write"+"&参数名="+某值);

window.open(url);

直接这样就可以打开一个新的填报子表。你只需要修改子报表路径 cptpath 、参数名、某值这三个就行,其他的不要动。

image.png

最佳回答
0
snrtuemcLv8专家互助
发布于2021-11-26 11:26

按钮弹出窗口js代码

var a=contentPane.getCellValue(sheet号,列号,行号);  //sheet号行号列号是从0开始  

var url = FR.cjkEncode("/webroot/decision/view/report?viewlet=GettingStarted.cpt&op=write&参数名="+a);

//窗体

var $iframe = $("<iframe id='inp' name='inp' width='100%' height='100%' scrolling='no' frameborder='0'>");

//将窗体的src属性设置为模板路径

$iframe.attr("src", url);

//窗体的属性

var o = {

    title: "对话框",    //标题

    width: 680,         //宽度

    height: 640,        //高度

    //closable:true,    //是否显示关闭按钮,默认true

    //confirm:true,     //是否添加确认取消按钮,默认false

    //draggable:true   //是否可拖动,默认true

};

//弹出窗体

FR.showDialog(o.title, o.width, o.height, $iframe, o);

最佳回答
0
吾姓独孤Lv6高级互助
发布于2021-11-26 11:27(编辑于 2021-11-26 11:28)

JS实现点击跳转页面和定时跳转页面-https://help.fanruan.com/finereport/doc-view-2128.html

连接后面加上参数op=write就是填报报表

JS实现点击单选按钮弹出对话框输入值-https://help.fanruan.com/finereport/doc-view-1211.html

也可以借鉴这个

最佳回答
0
linbodingLv6中级互助
发布于2021-11-26 11:29

window.open("链接&op=write&参数名="+a)

最佳回答
0
Z4u3z1Lv6专家互助
发布于2021-11-26 11:33

image.png

  • 5关注人数
  • 221浏览人数
  • 最后回答于:2021-11-26 13:34
    请选择关闭问题的原因
    确定 取消
    返回顶部