Interface IExcelWriter
Namespace: LemonEdge.Client.Core.Support
Assembly: LemonEdge.ClientCore.dll
Syntax
public interface IExcelWriter
Properties
HasExcelFileHandler
Indicates if there is client handler set for handling a csv file in excel by this application
Declaration
bool HasExcelFileHandler { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
MergeExcelFiles(IEnumerable<FileInfo>, string, bool)
Declaration
void MergeExcelFiles(IEnumerable<FileInfo> files, string fileName, bool deleteOriginals = false)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<FileInfo> | files | |
string | fileName | |
bool | deleteOriginals |
SetHandler(Func<ExcelFileInfo, Task>, Func<ExcelFileInfo, Task>, Action<IEnumerable<FileInfo>, string, bool>)
Sets a custom handler in the client application that will open the provided excel files instead of saving them to disk if the user wants
Does not need to be set the default implementation by every client is just to prompt the user where to save the file locally so they can open it themselves.
Declaration
void SetHandler(Func<ExcelFileInfo, Task> excelFileHandler, Func<ExcelFileInfo, Task> wordFileHandler, Action<IEnumerable<FileInfo>, string, bool> merger)
Parameters
Type | Name | Description |
---|---|---|
Func<ExcelFileInfo, Task> | excelFileHandler | The handler function that will open a specified csv file correctly in excel |
Func<ExcelFileInfo, Task> | wordFileHandler | |
Action<IEnumerable<FileInfo>, string, bool> | merger |
WriteExcelFile(IRootController, ExcelFileInfo, bool?)
Indicates that a csv, or excel file, should be written to the local system.
If a client application handler has been set, then it will handle it (such as by opening it in excel), otherwise it will save it locally to disk
Declaration
Task WriteExcelFile(IRootController rootController, ExcelFileInfo info, bool? exportStraightToExcel = null)
Parameters
Type | Name | Description |
---|---|---|
IRootController | rootController | The root controller, for service access |
ExcelFileInfo | info | The info for the excel file to be generated |
bool? | exportStraightToExcel |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |