| | |
| | | public Dictionary<string, Dictionary<string, string>> WorksheetColumns { get; set; } |
| | | public Dictionary<string, DataTable> WorksheetDataTable { get; set; } |
| | | |
| | | public ExcelExportSet() |
| | | { |
| | | Worksheets = new List<string>(); |
| | | WorksheetColumns = new Dictionary<string, Dictionary<string, string>>(); |
| | | WorksheetDataTable = new Dictionary<string, DataTable>(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | public static byte[] ExportExcel(ExcelExportSet excelExportDto, bool showSrNo = false) |
| | | { |
| | | //ExcelPackage.LicenseContext = LicenseContext.Commercial; 5.0以上版本 需要授权 |
| | | byte[] result = null; |
| | | using (ExcelPackage package = new ExcelPackage()) |
| | | { |
| | |
| | | workSheet.InsertRow(1, 1); |
| | | workSheet.Column(1).Width = 5; |
| | | } |
| | | result = package.GetAsByteArray(); |
| | | } |
| | | result = package.GetAsByteArray(); |
| | | } |
| | | return result; |
| | | } |