我正在使用 EEPLUS 导出用于该 DataValidation 列表的预格式化 Excel,但在大型列表中出现错误,这是代码:
ExcelPackage pck = new ExcelPackage();
var ws = pck.Workbook.Worksheets.Add("Testing");
ws.Cells["A1"].Value = "Column A";
ws.Cells["B1"].Value = "Column B";
ws.Cells["C1"].Value = "Column C";
ws.Cells["A1:C1"].Style.Fill.PatternType = ExcelFillStyle.Solid;
ws.Cells["A1:C1"].Style.Fill.BackgroundColor.SetColor(Color.FromArgb(184, 204, 228));
ws.Cells["A1:C1"].Style.Font.Bold = true;
var val = ws.DataValidations.AddListValidation("B2:B10000");
val.ShowErrorMessage = true;
val.Formula.Values.Add("Add");
val.Formula.Values.Add("Delete");
var val2 = ws.DataValidations.AddListValidation("C2:C10000");
val2.ShowErrorMessage = true;
foreach (var student in classroomDictionary) val2.Formula.Values.Add(student["Name"]);
Response.BinaryWrite(pck.GetAsByteArray());
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("Content-Disposition", String.Format("attachment; filename=etiquetas-{0}.xlsx", DateTime.Now.ToString("ddMMyyyy")));
如您所见,我正在使用 DataValidation ListValidation 创建 3 列,其中第 2 列和第 3 列。第二列效果很好,但是我添加 200 个项目的 3r 创建了 Excel 工作簿,但是当我尝试打开时出现错误。物品数量有限制吗?是 Excel 限制或 EEPLUS 限制还是我的代码有问题?
英文 sai 类似:Excel 发现无法阅读的内容...您要恢复图书内容吗?...
谢谢你