Table of Contents

Class XlsxExportHelper

Namespace
Shift.Toolbox
Assembly
Shift.Toolbox.dll
public class XlsxExportHelper
Inheritance
XlsxExportHelper
Inherited Members
Extension Methods

Constructors

XlsxExportHelper()

public XlsxExportHelper()

XlsxExportHelper(TimeZoneInfo)

public XlsxExportHelper(TimeZoneInfo timeZone)

Parameters

timeZone TimeZoneInfo

Fields

HeaderStyleName

public const string HeaderStyleName = "Header"

Field Value

string

Methods

ApplyColumnFormatting(ExcelWorksheet, IEnumerable, int)

public void ApplyColumnFormatting(ExcelWorksheet sheet, IEnumerable source, int startColumn)

Parameters

sheet ExcelWorksheet
source IEnumerable
startColumn int

ApplyColumnWidth(ExcelWorksheet, int, bool)

public void ApplyColumnWidth(ExcelWorksheet sheet, int startColumn, bool autoFit)

Parameters

sheet ExcelWorksheet
startColumn int
autoFit bool

GetXlsxBytes(Action<ExcelPackage>)

public byte[] GetXlsxBytes(Action<ExcelPackage> build)

Parameters

build Action<ExcelPackage>

Returns

byte[]

GetXlsxBytes(IEnumerable, string, bool, bool)

public byte[] GetXlsxBytes(IEnumerable source, string sheetName, bool renderHeader = true, bool autoColumnWidth = true)

Parameters

source IEnumerable
sheetName string
renderHeader bool
autoColumnWidth bool

Returns

byte[]

GetXlsxBytes(IListSource, string, bool, bool)

public byte[] GetXlsxBytes(IListSource source, string sheetName, bool renderHeader = true, bool autoColumnWidth = true)

Parameters

source IListSource
sheetName string
renderHeader bool
autoColumnWidth bool

Returns

byte[]

InsertData(ExcelWorksheet, IEnumerable, int, int, bool)

public int InsertData(ExcelWorksheet sheet, IEnumerable source, int startRow, int startColumn, bool applyCellsFormatting = true)

Parameters

sheet ExcelWorksheet
source IEnumerable
startRow int
startColumn int
applyCellsFormatting bool

Returns

int

InsertHeader(ExcelWorksheet, int, int, bool)

public void InsertHeader(ExcelWorksheet sheet, int startRow, int startColumn, bool applyCellsFormatting = true)

Parameters

sheet ExcelWorksheet
startRow int
startColumn int
applyCellsFormatting bool

Map(string, string)

public void Map(string property, string name)

Parameters

property string
name string

Map(string, string, HorizontalAlignment)

public void Map(string property, string name, HorizontalAlignment alignment)

Parameters

property string
name string
alignment HorizontalAlignment

Map(string, string, double)

public void Map(string property, string name, double width)

Parameters

property string
name string
width double

Map(string, string, double, HorizontalAlignment)

public void Map(string property, string name, double width, HorizontalAlignment alignment)

Parameters

property string
name string
width double
alignment HorizontalAlignment

Map(string, string, string)

public void Map(string property, string name, string format)

Parameters

property string
name string
format string

Map(string, string, string, double?, HorizontalAlignment?)

public void Map(string property, string name, string format, double? width, HorizontalAlignment? alignment)

Parameters

property string
name string
format string
width double?
alignment HorizontalAlignment?

RebuildMapping()

public void RebuildMapping()