帆软报表技巧
var p3 =contentPane.getWidgetByName("yzj");
p3.setEnable(true);
子窗口关闭刷新父页面
window.onunload = function(){ this.opener.location.reload(); }
怎样让选中下拉框的值就可以联动而不用点查询按钮了。
肯定是给控件添加事件了,点击事件tab页,添加一个编辑后事件,js如下:
_g().parameterCommit();
刷新sheet
contentPane.refreshAllSheets();
$("#r-9-0").toggle();
--------------------------------------
contentPane.curLGP.selectTDCell('B5');
var mc = contentPane.curLGP.getCellValue('B' + row);
contentPane.curLGP.setCellValue('D' + row, null, dw);
var gg = this.getValue(); //获取地区
var dl = contentPane.curLGP.getCellValue("B" + row);
var pm = contentPane.curLGP.getCellValue("C" + row);
setTimeout(function() {
var dw;
var sql = "select spdw from DM_sp WHERE SPDL=\'" + dl + "\' and spmc=\'" + pm + "\' and spgg=\'" + gg + "\'";
//sql="SELECT cldw,dj FROM DM_CLMX"
dw = FR.remoteEvaluate("sql(\"oracle_aly\",\"" + sql + "\",1,1)");
‘’‘’‘’
contentPane.setCellValue("F"+row, null, dw);
//contentPane.curLGP.setCellValue('F' + row, null, 'dw');
//contentPane.curLGP.setCellValue('A1', null, dw);
}, 200);
//alert(A);
var num= A.replace(/[^0-9]/ig,"");
var location = this.options.location; //获取当前控件的位置
var cr = FR.cellStr2ColumnRow(location);
var col = cr.col; //列号
var ro = cr.row; //行号
contentPane.setCellValue(1,ro,num);//此处1位B1的列号,默认从0开始
contentPane.writeReport();
var a = this.getValue();
var b = this.options.location; //获取当前单元格
contentPane.gotoPage(1);
var obj1 = FR.cellStr2ColumnRow(b); // 将单元格转换为行列
var c = obj1.col; // 获得行列号。
var d = obj1.row;
if (a.length < 1)
{
FR.Msg.toast("填入的值不够长。");
var cell = contentPane.curLGP.getTDCell(c,10); //获得当前焦点的单元格对象
setTimeout(
function()
{
contentPane.curLGP.selectTDCell(cell);//选择单元格
setTimeout(
function()
{
contentPane.curLGP.editTDCell(cell);//编辑单元格,即聚焦单元格
},20);
},20)
}
控件.setEnable(true/false);
var p3 =contentPane.getWidgetByName("yzj");
var p2 =contentPane.getWidgetByName("jjx");
p3.setEnable(true);
p2.setEnable(true);
var a = this.getValue();
contentPane.setCellValue("A1", null, a);
var dw="a,b,c"
if (dw.indexOf(a)==-1 )
{
contentPane.setCellValue("T14", null, "a");
p2.setEnable(false);
};
if (a.indexOf("b")!=-1 )
{
contentPane.setCellValue("B15", null, "无");
p3.setEnable(false);
}
contentPane.currentSessionID
var i=7;
var m;
alert(1);
while(i<20){
m=contentPane.curLGP.getCellValue('B' + i);
alert(m);
if (m=='合计'){
alert(i);
break;
}
i++;
};
删除表
contentPane.curLGP.getCellValue(1, 0);
//获取文本框控件所在单元格的值
var yea=contentPane.curLGP.getCellValue("C1");
var mon=contentPane.curLGP.getCellValue("E1");
var tmp =String.format("SQL('hr', 'DELETE FROM HR.FOOD WHERE YEA = {0} AND MON = {1}',1)",yea, mon);
var a = FR.remoteEvaluate(tmp);
if(a == 0){
FR.Msg.toast('删除成功');
}else{
FR.Msg.toast('删除失败');
}
var sql = "SQL(\"shk_gt3\",\"DELETE FROM md_group_mx WHERE JTMC LIKE \'%(集团)%\'\",1)";
alert(sql);
var a = FR.remoteEvaluate(sql);
if (a == 0) {
FR.Msg.toast('删除md_group_mx成功');
} else {
FR.Msg.toast('删除md_group_mx失败');
}
插入表
sql = String.format("sql(\"shk_gt3\",\"INSERT INTO md_group_mx SELECT {0}, djxh, {1} FROM MD_YAOYUEHUI_NSRSBH b, dj_nsrxx d WHERE NVL(shxydm, d.nsrsbh) = b.nsrsbh \",1)", "\'(集团)\'", "\'Y\'");
alert(sql);
a = FR.remoteEvaluate(sql);
if (a == 0) {
FR.Msg.toast('插入md_group_mx成功');
} else {
FR.Msg.toast('插入md_group_mx失败');
}
全部折叠-展开
var t = 3;
for(var m = 1; m <= t; m++) {
//循环执行“+”号展开
$('.x-treenode-unexpand').trigger('click');
}
for(var n = 1; n <= 2; n++) {
//执行点击2次(下标从0开始)第1个样式为“fr-widget-click”的元素,定位光标
$('.fr-widget-click').eq(0).trigger('click');
}
var t = 3;
for(var m = 1; m <= t; m++) {
//循环执行“-”号收起
$('.x-treenode-expand').trigger('click');
}
for(var n = 1; n<= 2; n++){
//执行点击2次(下标从0开始)第1个样式为“fr-widget-click”的元素,定位光标
$('.fr-widget-click').eq(0).trigger('click');
}