阔以是阔以,
1. 挂起计算引擎
2. 设置计算模式为手动计算
3. 设置公式
4. 唤醒计算引擎
5. 手动计算需要区域
小试了波代码
- var spread = new GC.Spread.Sheets.Workbook("ss");
- var sheet = spread.getActiveSheet();
- spread.suspendCalcService();
- spread.options.calculationMode = GC.Spread.Sheets.CalculationMode.manual;
- sheet.setValue(0, 0, 1)
- sheet.setFormula(1, 0, 'A1*2');
- sheet.setFormula(2, 0, 'A2*2');
- sheet.setFormula(3, 0, 'A3*2');
- sheet.setFormula(4, 0, 'POWER(3,3)');
- spread.resumeCalcService();
- spread.calculate(GC.Spread.Sheets.CalculationType.minimal, 'Sheet1!A5')
复制代码
核心API: https://demo.grapecity.com.cn/spreadjs/help/api/classes/GC.Spread.Sheets.Workbook#calculate
你可以自己玩玩 |