回复 10楼guxinghan的帖子
guxinghan 您好,
很感谢您的详细描述,我根据描述做了以下操作:
1.创建 excel,普通单元格中包含行头行和带有背景色和公式的行。
2.通过 Spread 加载,做了以下设置:
-
- protected void Button1_Click(object sender, EventArgs e)
- {
- this.FpSpread1.OpenExcel(this.Server.MapPath("Book1.xlsx"), FarPoint.Excel.ExcelOpenFlags.TruncateEmptyRowsAndColumns);
-
- // 样式拷贝
- FarPoint.Web.Spread.Model.DefaultSheetStyleModel modelSty = (FarPoint.Web.Spread.Model.DefaultSheetStyleModel)FpSpread1.ActiveSheetView.StyleModel;
- // 数据(公式)拷贝
- FarPoint.Web.Spread.Model.DefaultSheetDataModel dmSty = (FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.ActiveSheetView.DataModel;
- this.FpSpread1.Sheets[0].RowCount=70;
- this.FpSpread1.Sheets[0].AllowPage=false;
- for (int i = 0; i < 70; i++)
- {
- for (int j = 0; j < 6; j++)
- {
- this.FpSpread1.Sheets[0].Cells[i, j].Locked = true;
- }
- }
- this.FpSpread1.Sheets[0].Protect = true;
- for (int i = 2; i < 70; i++)
- {
- modelSty.Copy(1, 0, i, 0, 1, 6);
- dmSty.Copy(1, 0, i, 0, 1, 6);
- }
- }
复制代码
然而没有重现问题,所以请您下载附件 Demo 测试看能否重现,我们会根据您的反馈信息进行进一步测试:
VS2013 + IE11 + Spread for ASP.NET 7.0V4
13791_ImportExcel.zip
(14 KB, 下载次数: 219)
|