CDISC导表库bug

This commit is contained in:
2025-06-19 17:35:24 +08:00
parent 27e8e0e79c
commit 41fe678708
6 changed files with 36 additions and 22 deletions
@@ -551,7 +551,7 @@ public static class ExcelExportHelper
}
//创建新的列
for (int i = originTotalEndIndex; i < originTotalEndIndex + needAddCount; i++)
for (int i = originRemoveEndIndex; i < originRemoveEndIndex + needAddCount; i++)
{
titelRow.CreateCell(i + 1);
@@ -585,6 +585,7 @@ public static class ExcelExportHelper
for (int i = dynamicColunmStartIndex; i < dynamicColunmStartIndex + needAddCount; i++)
{
var name = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].Name;
titelRow.GetCell(i).SetCellValue(name);
@@ -597,8 +598,10 @@ public static class ExcelExportHelper
cdicsRow.GetCell(i).SetCellValue(cdicsCode);
}
}
}
using (var memoryStream2 = new MemoryStream())
{
workbook.Write(memoryStream2, true);
@@ -621,8 +624,11 @@ public static class ExcelExportHelper
IgnoreTemplateParameterMissing = true,
};
//await MiniExcel.SaveAsByTemplateAsync("testmini.xlsx", templateStream.ToArray(), translateData);
await MiniExcel.SaveAsByTemplateAsync(memoryStream, templateStream.ToArray(), translateData, config);
memoryStream.Seek(0, SeekOrigin.Begin);
if (dynamicColumnConfig != null)