|
|
|
@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Http; |
|
|
|
|
using NPOI.HSSF.UserModel; |
|
|
|
|
using NPOI.OpenXmlFormats.Spreadsheet; |
|
|
|
|
using NPOI.POIFS.NIO; |
|
|
|
|
using NPOI.SS.Formula.Functions; |
|
|
|
|
using NPOI.SS.UserModel; |
|
|
|
|
using NPOI.SS.Util; |
|
|
|
|
using NPOI.XSSF.UserModel; |
|
|
|
@ -218,11 +219,16 @@ public static class ReportHelper |
|
|
|
|
string dataSource = tableColumn[j].dataSource; |
|
|
|
|
string field = tableColumn[j].field; |
|
|
|
|
string label = tableColumn[j].label; |
|
|
|
|
headerRow.CreateCell(j).SetCellValue(label); |
|
|
|
|
var cel2 = headerRow.CreateCell(j); |
|
|
|
|
cel2.SetCellValue(label); |
|
|
|
|
if (tableColumn[j].required == "true") |
|
|
|
|
headerRow.GetCell(j).CellStyle = headRequiredStyle; |
|
|
|
|
else |
|
|
|
|
headerRow.GetCell(j).CellStyle = headStyle; |
|
|
|
|
|
|
|
|
|
if (tableColumn[j].Comment.IsNotEmptyOrNull()) |
|
|
|
|
cel2.CellComment = GetComment(sheet, null, j, tableColumn[j].Comment); |
|
|
|
|
|
|
|
|
|
//设置列宽 |
|
|
|
|
//sheet.SetColumnWidth(column.Ordinal, (arrColWidth[column.Ordinal] + 1) * 256); |
|
|
|
|
if (arrColWidth[j] > 255) |
|
|
|
@ -234,6 +240,7 @@ public static class ReportHelper |
|
|
|
|
sheet.SetColumnWidth(j, (arrColWidth[j] + 1) * 256); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//是否下拉 |
|
|
|
|
if (!string.IsNullOrEmpty(dataSource) |
|
|
|
|
&& !dataSource.StartsWith("OrgTreeWith") |
|
|
|
@ -828,7 +835,6 @@ public static class ReportHelper |
|
|
|
|
/// <returns></returns> |
|
|
|
|
public static async Task<(List<Dictionary<string, object>>, int)> ValidImportExcel(ISqlSugarClient Db, List<QueryExportColumn> columns, DataTable dt) |
|
|
|
|
{ |
|
|
|
|
bool result = false; |
|
|
|
|
int ErrorCount = 0; |
|
|
|
|
var dictList = new List<Dictionary<string, object>>(); |
|
|
|
|
for (int i = 0; i < dt.Rows.Count; i++) |
|
|
|
@ -929,7 +935,6 @@ public static class ReportHelper |
|
|
|
|
{ |
|
|
|
|
dt.Rows[i]["Comments"] = string.Join(";", comments.Select(a => a)); |
|
|
|
|
ErrorCount++; |
|
|
|
|
result = true; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|