Commit 102ca9e4 by Licx

提取数据新建sheet异常修改

parent b6d905e6
......@@ -84,7 +84,6 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
ExcelStyle style = new ExcelStyle(workbook);
var cellStyle = style.SetBgkColorAndFormat(style.GetCellStyle(), StyleType.列头, CellFormat.默认);
var item = pairs.Where(t => t.Key.ToString().NoBlank().StartsWith("1.0.")).OrderByDescending(t => t.Key).First();
var newSheet = workbook.CreateSheet(module.ModuleName);
newSheet.GetOrCreate(1).GetOrCreate(6).SetCellValue("护理组分割比例:");
newSheet.GetOrCreate(1).GetOrCreate(6).CellStyle = cellStyle;
......@@ -115,9 +114,9 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
var sheet = workbook.GetSheet(module.ModuleName) ?? workbook.GetSheet(module.ModuleName.NoBlank());
if (sheet == null)
{
var item = pairs.Where(t => t.Key.ToString().NoBlank().StartsWith("3.")).OrderByDescending(t => t.Key).First();
var copysheet = workbook.GetSheet(item.Key);
if (copysheet == null) continue;
var item = pairs.Where(t => t.Key.ToString().NoBlank().StartsWith("3.")).OrderByDescending(t => t.Key).FirstOrDefault();
var copysheet = workbook.GetSheet(item.Key ?? "");
if (copysheet == null) break;
var newSheet = copysheet.CopySheet(module.ModuleName, true);
workbook.SetSheetOrder(newSheet.SheetName, workbook.NumberOfSheets - 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment