Table of Contents

Class ExcelWriter

Namespace
Dynamicweb.Data
Assembly
Dynamicweb.Data.dll
Excel exporter that handles merging object values into placeholders in worksheet
public class ExcelWriter
Inheritance
ExcelWriter
Inherited Members

Remarks

https://github.com/JanKallman/EPPlus/issues/335 -> conditional formatting needs custom handling, because EPPlus does not handle them correctly

Properties

AutoFitMaxWidth

Makes it possible to control the maximum width of the columns in the worksheet
public int AutoFitMaxWidth { get; set; }

Property Value

int

AutoFitMinWidth

Makes it possible to control the minimum width of the columns in the worksheet
public int AutoFitMinWidth { get; set; }

Property Value

int

BindingFlags

Make it possible to change the way properties are fetched from the object.
public BindingFlags BindingFlags { get; set; }

Property Value

BindingFlags

Debug

Make it possible to pass debug configuration to change what is written.
public string Debug { get; set; }

Property Value

string

Examples

"UseLoops,Replace,DeleteCommands,FixWidth"

Remarks

Currently supports comma-seperated instructions Help UseLoops Replace DeleteCommands FixWidth

FileName

Filename where placeholders are replaced if possible.
public string FileName { get; }

Property Value

string

TypesToHideFromHelp

Configuration of types that should not be printed in the help-excel file, for brevity
public HashSet<Type> TypesToHideFromHelp { get; set; }

Property Value

HashSet<Type>

Methods

Write<T>(T, FileInfo, FileInfo)

Merges an objects values into a worksheet
public void Write<T>(T objectToExport, FileInfo master, FileInfo newFile) where T : class

Parameters

objectToExport T
Object containing values to merge
master FileInfo
Excel with worksheet containing placeholders and commands
newFile FileInfo
Output excel file location

Type Parameters

T
Type of object to merge

Write<T>(T, string)

Merges an objects values into a worksheet
public byte[] Write<T>(T objectToExport, string pathToMaster) where T : class

Parameters

objectToExport T
Object containing values to merge
pathToMaster string
Excel with worksheet containing placeholders and commands

Returns

byte[]
Bytestream of excel

Type Parameters

T
Type of object to merge

Write<T>(T, string, string)

Merges an objects values into a worksheet
public void Write<T>(T objectToExport, string pathToMaster, string pathToNewFile) where T : class

Parameters

objectToExport T
Object containing values to merge
pathToMaster string
Excel with worksheet containing placeholders and commands
pathToNewFile string
Output excel file location

Type Parameters

T
Type of object to merge
To top