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();

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM