在模板里面设置公式只会填充第一行,如果在代码里面设置公式渲染效率太低了,我的代码是这样的:
AjaxPost("/Handlers/TJBB/TJBBHandler.ashx?Action=GetJDJH_ReportData", function (data) {
if (data) {
var bindData = new GC.Spread.Sheets.Bindings.CellBindingSource(data);
sheet = spread.getActiveSheet();
sheet.setDataSource(bindData);
//设置高度及计算公式
for (var i = 5; i <= data.JDJH_List.length + 4; i++) {
sheet.setRowHeight(i, 28);
sheet.setFormula(i, 7, "=G" + (i + 1) + "-E" + (i + 1));
sheet.setFormula(i, 13, "=M" + (i + 1) + "-K" + (i + 1));
sheet.setFormula(i, 19, "=S" + (i + 1) + "-Q" + (i + 1));
sheet.setFormula(i, 22, "=V" + (i + 1) + "-U" + (i + 1));
sheet.setFormula(i, 23, "=V" + (i + 1) + "-B" + (i + 1));
}
}
}, model, true);
有什么好的解决方法吗?
|
|