public static void FillExcel <TBody, TBodyList, THeader>(string configFile, string tableId, string exportId, string templateFile, Stream targetStream, TBodyList tList, THeader tHeader, GetValueHandler <object> getHeaderValueCallback = null) where TBody : class where TBodyList : class { NPOIExport <TBody, TBodyList> export = CreateNPOIExport <TBody, TBodyList>(configFile, tableId, exportId, null, null, null, null, null, null, null, getHeaderValueCallback); export.Fill(templateFile, targetStream, tList, tHeader); export.Dispose(); }
/// <summary> /// Export data to a stream /// </summary> /// <param name="stream"></param> /// <param name="tList"></param> public static void ExportExcel <TBody, TBodyList>(string configFile, string tableId, string exportId, Stream stream, TBodyList tList, DataValidatingHandler <TBody, TBodyList> dataValidater = null, ExtendDataWritingHandler <TBody, TBodyList> extendDataWriter = null, TableWritingHandler tableHeaderWriter = null, TableWritingHandler tableFooterWriter = null, PageWritingHandler pageHeaderWriter = null, PageWritingHandler pageFooterWriter = null, GetValueHandler <TBody> getValueCallback = null) where TBody : class where TBodyList : class { NPOIExport <TBody, TBodyList> export = CreateNPOIExport <TBody, TBodyList>(configFile, tableId, exportId, dataValidater, extendDataWriter, tableHeaderWriter, tableFooterWriter, pageHeaderWriter, pageFooterWriter, getValueCallback, null); export.Export(stream, tList); export.Dispose(); }