Class ExcelWriter
An optional handler that allows client applications to implement excel integration
Whenever the application has a file that can be opened in excel (csv) it just asks the user for a file path/location and saves it leaving them to open it
However if a seperate handler is set using this class then it is provided the handler the option to open the excel file instead. This is implemented by the windows client application to provide seamless excel integration.Inheritance
Inherited Members
Namespace: LemonEdge.Client.Core.Support
Assembly: ClientCore.dll
Syntax
public static class ExcelWriter
Properties
HasExcelFileHandler
Indicates if there is client handler set for handling a csv file in excel by this application
Declaration
public static bool HasExcelFileHandler { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
SetHandler(Func<ExcelFileInfo, Task>)
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
public static void SetHandler(Func<ExcelFileInfo, Task> excelFileHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Func<ExcelFileInfo, System.Threading.Tasks.Task> | excelFileHandler | The handler function that will open a specified csv file correctly in excel |
WriteExcelFile(ExcelFileInfo, Nullable<Boolean>)
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
public static Task WriteExcelFile(ExcelFileInfo info, bool? exportStraightToExcel = default(bool? ))
Parameters
Type | Name | Description |
---|---|---|
ExcelFileInfo | info | The info for the excel file to be generated |
System.Nullable<System.Boolean> | exportStraightToExcel |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |