finereport JS 获取按钮所在单元格的值及获取当前报表的变量

1、通过按钮获取单元格所在的值

debugger;
var cr;
if(window.lineboxes) {  
    var cells = [];  
    for (var i = 0; i < lineboxes.length; i++) {  
    if (lineboxes[i].selected()) {  
        cells[cells.length] = lineboxes[i].options.location;
        cr=FR.cellStr2ColumnRow(window.lineboxes[i].options.location);   
        }  
    }
    
    if(cells.length==0 || cells.length>1){
        FR.Msg.alert("警告","请选择一个计划任务进行查看!");
        }else{
var yearsmonth=_g().getCellValue(3, cr.row)
var bmid=_g().getCellValue(7, cr.row) //7是部门ID 9是部门名称
//FR.Msg.alert(bmid,"666")
window.open("${servletURL}?reportlet=/?/?.cpt&op=write_plus&yearsmonth="+yearsmonth+"&bmid="+bmid)


   }
}

2、获取变量的实时变化的值

var a=this.options.form.getWidgetByName("name").getValue();

  

posted @ 2019-10-19 10:16  洺剑残虹  阅读(4786)  评论(0编辑  收藏  举报