现在又遇到一个问题:页面中写了一段添加公式的语句,
//设置列公式
//sheet.isPaintSuspended(true);
var sTable = sheet.findTableByName("gcTable0");
sTable.setColumnDataFormula(4, '=AVERAGEIF(([@Col_1],[@Col_2],[@Col_3]),">0"');//如果只计算当前行的列 前面加@ 否则是指的整个列
sTable.setColumnDataFormula(8, '=AVERAGEIF(([@Col_5],[@Col_6],[@Col_7]),">0"');
sTable.setColumnDataFormula(12, '=AVERAGEIF(([@Col_9],[@Col_10],[@Col_11]),">0"');
//回收率公式 精品位(原品-尾矿品)/原品(精品-尾品)
sTable.setColumnDataFormula(13, '=([@Col_5]*([@Col_1]-[@Col_9]))*100/([@Col_1]*([@Col_5]-[@Col_9]))');
sTable.setColumnDataFormula(14, '=([@Col_6]*([@Col_2]-[@Col_10]))*100/([@Col_2]*([@Col_6]-[@Col_10]))');
sTable.setColumnDataFormula(15, '=([@Col_7]*([@Col_3]-[@Col_11]))*100/([@Col_3]*([@Col_7]-[@Col_11]))');
sTable.setColumnDataFormula(16, '=([@Col_8]*([@Col_4]-[@Col_12]))*100/([@Col_4]*([@Col_8]-[@Col_12]))');
可是第一次查询,公式就显示正常,也能计算,但是再进行第二次查询时候,公式就没有了,跟踪列代码也走了此段程序,可是就是页面中不显示,调用的就是一个查询
|
|