回复 1楼baigenliang的帖子
建议1:请问当前的模板是由Excel导入进来的吗?我查看模板中有很多单元格类型为 TextCellType,如果不是项目要求设置,请更改为 GeneralCellType。
建议2:提供一个缓解一次性性能的方法,使用按需加载进行分批显示,请修改 WebForm2.aspx Load 方法如下:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- for (int i = 0; i < FpSpread2.Sheets.Count; i++)
- {
- FpSpread2.Sheets[i].AllowPage = false;
- FpSpread2.Sheets[i].PageSize = 70;
- this.FpSpread2.Sheets[i].Protect = true;
- //按需加载
- this.FpSpread2.Sheets[i].AllowLoadOnDemand = true;
- this.FpSpread2.Sheets[i].LoadInitRowCount = 25;
- this.FpSpread2.Sheets[i].LoadRowIncrement = 5;
- this.FpSpread2.Sheets[i].LoadOnDemandMode = FarPoint.Web.Spread.LoadOnDemandMode.Background;
- this.FpSpread2.Sheets[i].LoadOnDemandTriggerMode = FarPoint.Web.Spread.LoadOnDemandTriggerMode.Timed;
- this.FpSpread2.Sheets[i].LoadOnDemandInterval = 100;
- }
- DefaultSheetDataModel dataModel = FpSpread2.ActiveSheetView.DataModel as FarPoint.Web.Spread.Model.DefaultSheetDataModel;
- if (dataModel != null)
- {
- dataModel.AddCustomFunction(new CubeFunctionInfo());
- dataModel.AddCustomFunction(new FoundOffFunctionInfo());
- dataModel.AddCustomFunction(new DevisionFunctionInfo());
- dataModel.AddCustomFunction(new Devision2FunctionInfo());
- dataModel.AddCustomFunction(new ChangeRateFunctionInfo());
- dataModel.AddCustomFunction(new Avg2DirectFunctionInfo());
- dataModel.AddCustomFunction(new Avg2JudgeFunctionInfo());
- dataModel.AddCustomFunction(new Avg3DirectFunctionInfo());
- dataModel.AddCustomFunction(new Avg3JudgefunctionInfo());
- dataModel.AddCustomFunction(new Avg3ZJZjudgefunctionInfo());
- dataModel.AddCustomFunction(new Avg3AvgJudgefunctionInfo());
- }
- this.FpSpread2.ClientAutoCalculation = true;
- // FpSpread2.ActiveSheetView.SetFormula(0, 0, "CUBE(CUBE(B1))");
- FpSpread2.ActiveSheetView.DataModel = dataModel;
- }
- }
复制代码 |