Excel.ExcelWriter<TModel> Class
Namespace: Nucleus.Extensions.Excel
Assembly: Nucleus.Extensions.dll
Class used to write (export) an Excel file from an IEnumerable of the class specified by TModel.
Type Parameters
| TModel |
Type being exported. |
Constructors
ExcelWriter<TModel>
ExcelWriter<TModel> ()
Use this constructor if you want to set up columns manually using the
AddColumn method.
ExcelWriter<TModel>
(Modes, String[]) Constructor
ExcelWriter<TModel> (Modes mode, String[] properties)
Use this constructor to automatically set up columns.
Methods
AddColumn<TModel>
(Expression<TModel>) Method
AddColumn<TModel> (Expression<TModel> expression)
Add a column using an expression to specify the column.
Parameters
| Name |
Type |
|
expression
|
System.Linq.Expressions.Expression<TModel>
|
AddColumn<TModel>
(String, String, XLDataType, Expression<TModel>) Method
AddColumn<TModel> (String name, String caption, XLDataType dataType, Expression<TModel> expression)
Add a column with an expression which is called to determine the output value.
Parameters
| Name |
Type |
|
name
|
String
|
|
caption
|
String
|
|
dataType
|
ClosedXML.Excel.XLDataType
|
|
expression
|
System.Linq.Expressions.Expression<TModel>
|
AddColumn<TModel>
(String, String, XLDataType, Expression<TModel>) Method
AddColumn<TModel> (String name, String caption, XLDataType dataType, Expression<TModel> expression)
Add a column with an expression which is called to determine the output value. This overload is for lambda expressions which do not reference the object being exported.
Parameters
| Name |
Type |
|
name
|
String
|
|
caption
|
String
|
|
dataType
|
ClosedXML.Excel.XLDataType
|
|
expression
|
System.Linq.Expressions.Expression<TModel>
|
Export
(IEnumerable<TModel>) Method
Export (IEnumerable<TModel> items)
Automatically export items to the current worksheet.
Parameters
| Name |
Type |
|
items
|
System.Collections.Generic.IEnumerable<TModel>
|