我正在使用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限制或我的代码有问题?
在英语中有类似的内容:Excel发现无法阅读的内容......您想要恢复图书内容吗?...
谢谢 BR