@@ -260,7 +260,9 @@ public static class ExcelExportHelper
|
||||
/// </summary>
|
||||
public int TempalteLastColumnIndex { get; set; }
|
||||
|
||||
public List<string> CDISCList { get; set; } = new List<string>();
|
||||
public bool IsCDISCExport { get; set; }=false;
|
||||
|
||||
//public List<string> CDISCList { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 动态的列名 如果Id 重复,那么就按照名称填充,否则就按照Id 填充列数据
|
||||
@@ -301,6 +303,8 @@ public static class ExcelExportHelper
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public string CDISCCode { get; set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is not ColumItem other) return false;
|
||||
@@ -489,7 +493,9 @@ public static class ExcelExportHelper
|
||||
|
||||
if (dynamicColumnConfig != null)
|
||||
{
|
||||
var isCdics = dynamicColumnConfig.CDISCList.Count > 0;
|
||||
//var isCdics = dynamicColumnConfig.CDISCList.Count > 0;
|
||||
|
||||
var isCdics = dynamicColumnConfig.IsCDISCExport;
|
||||
|
||||
var sheet = workbook.GetSheetAt(0);
|
||||
|
||||
@@ -546,7 +552,7 @@ public static class ExcelExportHelper
|
||||
//创建新的列
|
||||
for (int i = originTotalEndIndex; i < originTotalEndIndex + needAddCount; i++)
|
||||
{
|
||||
|
||||
|
||||
titelRow.CreateCell(i + 1);
|
||||
templateRow.CreateCell(i + 1);
|
||||
|
||||
@@ -565,6 +571,11 @@ public static class ExcelExportHelper
|
||||
titelRow.GetCell(i).SetCellValue(titelRow.GetCell(i - gap).StringCellValue);
|
||||
|
||||
templateRow.GetCell(i).SetCellValue(templateRow.GetCell(i - gap).StringCellValue);
|
||||
|
||||
if (isCdics)
|
||||
{
|
||||
cdicsRow.GetCell(i).SetCellValue(cdicsRow.GetCell(i - gap).StringCellValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -580,7 +591,7 @@ public static class ExcelExportHelper
|
||||
|
||||
if (isCdics)
|
||||
{
|
||||
var cdicsCode = dynamicColumnConfig.CDISCList[i - dynamicColunmStartIndex];
|
||||
var cdicsCode = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].CDISCCode;
|
||||
|
||||
cdicsRow.GetCell(i).SetCellValue(cdicsCode);
|
||||
}
|
||||
@@ -907,7 +918,7 @@ public static class ExcelExportHelper
|
||||
{
|
||||
var name = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].Name;
|
||||
|
||||
var cdicsCode = dynamicColumnConfig.CDISCList[i - dynamicColunmStartIndex];
|
||||
var cdicsCode = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].CDISCCode;
|
||||
|
||||
cdicsRow.GetCell(i).SetCellValue(cdicsCode);
|
||||
titelRow.GetCell(i).SetCellValue(name);
|
||||
|
||||
Reference in New Issue
Block a user