public ISheetWriteContext CrateSheet <T>(string sheetName, uint autoSplit = 1048200) where T : class, new() { var sortedProps = ReflectionHelper.NewInstance.GetSortedExportProps <T>(); var sheet = MultiStageExporter.CreteSheet(_fileId, sheetName, sortedProps.Select(t => t.attr).ToList()); return(new SheetWriteContext(_fileId, autoSplit, sheet)); }
public void AppendData(string sheetName, Dictionary <string, object> rowData) { if (rowData == null || rowData.Count == 0) { return; } MultiStageExporter.AppendData(_fileId, sheetName, rowData, _autoSplit); }
public void AppendData <T>(string sheetName, T rowData) where T : class, new() { if (rowData == null) { return; } MultiStageExporter.AppendData(_fileId, sheetName, rowData, _autoSplit); }
protected virtual void Dispose(bool disposing) { if (!disposing) { return; } MultiStageExporter.Dispose(_fileId); GC.SuppressFinalize(this); }
public ISheetWriteContext CrateSheet(string sheetName, List <ExcelKitAttribute> headers, uint autoSplit = 1048200) { Inspector.NotNullAndHasElement(headers, "动态表头信息不能为空"); Inspector.Validation(headers.Count(t => string.IsNullOrWhiteSpace(t.Code)) > 0, "表头信息中存在Code为空的列字段"); Inspector.Validation(headers.Count(t => string.IsNullOrWhiteSpace(t.Desc)) > 0, "表头信息中存在Desc为空的列字段"); headers = headers.Where(t => t.IsIgnore == false).ToList(); headers.RemoveAll(t => t.IsOnlyIgnoreWrite); var sheet = MultiStageExporter.CreteSheet(_fileId, sheetName, headers); return(new SheetWriteContext(_fileId, autoSplit, sheet)); }
public string Save(string saveForder = null) { return(MultiStageExporter.Save(_fileId, saveForder)); }
public OutExcelInfo Generate() { return(MultiStageExporter.Generate(_fileId)); }
public string SafeSheetName(string sheetName) { return(MultiStageExporter.SafeSheetName(sheetName)); }
public ExcelWriteContext(string fileName) { _fileId = MultiStageExporter.CreateExcel(fileName); }