华表 单元格公式设定与计算
2006-12-12 11:05
169 查看
本例主要内容为
1.设置Sum()公式 并进行计算
2.设置表格框线
3.合并单元格 并进行对齐设置
document.form1.Cellweb1.ProtectFormula=false;
document.form1.Cellweb1.CalcManaually=true;
var currCol = colNum + 3;
for(var i=3;i<currCol;i++)
{
//Sum(A1:A9) 公式的计算范围设定
var sCell = document.form1.Cellweb1.CellToLabel(i,7);
var eCell = document.form1.Cellweb1.CellToLabel(i,6+rowNum);
var str = "Sum("+sCell+":"+eCell+")";
var aaa=document.form1.Cellweb1.SetFormula(i,6,0,str);
}
//公式计算
document.form1.Cellweb1.CalculateAll();
//设置表格框线
document.form1.Cellweb1.DrawGridLine(2,26,2+colNum,6+rowNum,0,2,-1);
//合并单元格
document.form1.Cellweb1.MergeCells(5,currRow,6,currRow);
//进行单元格赋值
document.form1.Cellweb1.SetCellString(5,currRow,0,"报表人");
//进行对齐设置
document.form1.Cellweb1.SetCellAlign (5,currRow,0,32+2);
document.form1.Cellweb1.MergeCells(7,currRow,8,currRow);
document.form1.Cellweb1.SetCellString(7,currRow,0,UserUpRpt);
document.form1.Cellweb1.SetCellAlign (7,currRow,0,32+1);
1.设置Sum()公式 并进行计算
2.设置表格框线
3.合并单元格 并进行对齐设置
document.form1.Cellweb1.ProtectFormula=false;
document.form1.Cellweb1.CalcManaually=true;
var currCol = colNum + 3;
for(var i=3;i<currCol;i++)
{
//Sum(A1:A9) 公式的计算范围设定
var sCell = document.form1.Cellweb1.CellToLabel(i,7);
var eCell = document.form1.Cellweb1.CellToLabel(i,6+rowNum);
var str = "Sum("+sCell+":"+eCell+")";
var aaa=document.form1.Cellweb1.SetFormula(i,6,0,str);
}
//公式计算
document.form1.Cellweb1.CalculateAll();
//设置表格框线
document.form1.Cellweb1.DrawGridLine(2,26,2+colNum,6+rowNum,0,2,-1);
//合并单元格
document.form1.Cellweb1.MergeCells(5,currRow,6,currRow);
//进行单元格赋值
document.form1.Cellweb1.SetCellString(5,currRow,0,"报表人");
//进行对齐设置
document.form1.Cellweb1.SetCellAlign (5,currRow,0,32+2);
document.form1.Cellweb1.MergeCells(7,currRow,8,currRow);
document.form1.Cellweb1.SetCellString(7,currRow,0,UserUpRpt);
document.form1.Cellweb1.SetCellAlign (7,currRow,0,32+1);
相关文章推荐
- 华表 单元格公式设定与计算
- 实现Excel行插入行删除特殊处理,单元格合并及动态条件单元格公式自动计算功能的VBA 宏示例
- Excel单元格无法输入内容,提示“已设定公式,请选择‘取消’退出”
- 使用Python获取Excel文件中单元格公式的计算结果
- Excel 2003 实用基础课程——第6章 计算公式设定
- Apach POI 如何拿到有公式的单元格,计算结果
- 自定义公式的计算处理
- QPS、PV与机器数量简单计算公式
- [计算几何]几何图形及计算公式查询
- 计算通话时间公式
- 快速计算某个日期是星期几的经验公式
- 并发用户数、吞吐量、思考时间的计算公式
- Google AdSense 的收入计算公式
- 腾讯qq等级计算公式面试题
- 推导基姆拉尔森公式根据日期计算星期
- 一些距离及相似度计算公式
- 计算两个坐标之间的距离公式
- Excel中公式的绝对引用和相对引用单元格
- 根据经纬度计算距离的公式
- 计算两点间距离公式