Search Results for

    Show / Hide Table of Contents

    Class ExcelWriter

    Inheritance
    object
    ExcelWriter
    Implements
    IExcelWriter
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Client.Core.Support
    Assembly: LemonEdge.ClientCore.dll
    Syntax
    public class ExcelWriter : IExcelWriter

    Constructors

    ExcelWriter()

    Declaration
    public ExcelWriter()

    Properties

    HasExcelFileHandler

    Indicates if there is client handler set for handling a csv file in excel by this application

    Declaration
    public bool HasExcelFileHandler { get; }
    Property Value
    Type Description
    bool

    HasWordFileHandler

    Declaration
    public bool HasWordFileHandler { get; }
    Property Value
    Type Description
    bool

    Instance

    Declaration
    public static IExcelWriter Instance { get; set; }
    Property Value
    Type Description
    IExcelWriter

    Methods

    MergeExcelFiles(IEnumerable<FileInfo>, string, bool)

    Declaration
    public 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
    public 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
    public 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

    Implements

    IExcelWriter

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.