Class EPPlusService
Inheritance
EPPlusService
Assembly: DataWeb.Data.Exchange.EPPlus.dll
Syntax
public class EPPlusService : IExcelService, IEPPlusService
Methods
DictionaryListToStreamAsync(IEnumerable<Dictionary<string, object>>, string, CancellationToken)
Converts a list of dictionaries to an Excel file and returns it as a stream.
Declaration
public Task<Stream> DictionaryListToStreamAsync(IEnumerable<Dictionary<string, object>> dictionaryList, string dataName, CancellationToken cancellationToken = default)
Parameters
Returns
| Type |
Description |
| Task<Stream> |
A stream that contains the Excel file.
|
DictionaryListToWorksheet(ExcelPackage, IEnumerable<Dictionary<string, object>>, string)
Declaration
public ExcelWorksheet DictionaryListToWorksheet(ExcelPackage package, IEnumerable<Dictionary<string, object>> dictionaryList, string worksheetName)
Parameters
Returns
| Type |
Description |
| ExcelWorksheet |
|
ListToStreamAsync(IEnumerable, string, CancellationToken)
Converts a list of objects to an Excel file and returns it as a stream.
Declaration
public Task<Stream> ListToStreamAsync(IEnumerable list, string dataName, CancellationToken cancellationToken = default)
Parameters
| Type |
Name |
Description |
| IEnumerable |
list |
The list of objects to convert to an Excel file.
|
| string |
dataName |
The name of the data to include in the Excel file.
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<Stream> |
A stream that contains the Excel file.
|
ListToWorksheet(ExcelPackage, IEnumerable, string)
Declaration
public ExcelWorksheet ListToWorksheet(ExcelPackage package, IEnumerable list, string worksheetName)
Parameters
Returns
| Type |
Description |
| ExcelWorksheet |
|
StreamToExcelDataAsync(Stream, CancellationToken)
Reads an Excel file from a stream and returns its data.
Declaration
public Task<ExcelData> StreamToExcelDataAsync(Stream stream, CancellationToken cancellationToken = default)
Parameters
Returns
| Type |
Description |
| Task<ExcelData> |
An ExcelData object that contains the data extracted from the Excel file.
|
WorksheetToExcelData(ExcelPackage)
Declaration
public ExcelData WorksheetToExcelData(ExcelPackage package)
Parameters
| Type |
Name |
Description |
| ExcelPackage |
package |
|
Returns
Implements