Class ExcelSource<TOutput>

Reads data from a excel source. While reading the data from the file, data is also asnychronously posted into the targets. You can define a sheet name and a range - only the data in the specified sheet and range is read. Otherwise, all data in all sheets will be processed.

Inheritance
System.Object
ExcelSource<TOutput>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.DataFlow.Connectors
Assembly: ETLBox.Excel.dll
Syntax
    public class ExcelSource<TOutput> : DataFlowStreamSource<TOutput>, ILoggableTask, IDataFlowLogging, IDataFlowStreamSource<TOutput>, IDataFlowExecutableSource<TOutput>, IDataFlowSource<TOutput>, IDataFlowSource, IDataFlowComponent, IDataFlowExecutableSource, IDataFlowStreamSource
Type Parameters
NameDescription
TOutput

Type of outgoing data

Examples
ExcelSource<ExcelData> source = new ExcelSource<ExcelData>("src/DataFlow/ExcelDataFile.xlsx") {
        Range = new ExcelRange(2, 4, 5, 9),
        SheetName = "Sheet2"
 };

Constructors

ExcelSource()

Declaration
    public ExcelSource()

ExcelSource(String)

Declaration
    public ExcelSource(string uri)
Parameters
TypeNameDescription
System.Stringuri

The source excel file name or uri

Properties

ExcelColumns

List of ExcelColumn attributes to map the excel column name with a property. E.g. if the excel has a column with the header "Key", and should be written into the property "Id", then you can simply add a ExcelColumn mapping: ExcelColumn: ColumnName "Key" -> PropertyName: "Id".
Alternatively, you can use the Index of the column, e.g. if Key is the first column: ColumnIndex "0" -> PropertyName: "Id".

Declaration
    public ICollection<ExcelColumn> ExcelColumns { get; set; }
Property Value
TypeDescription
System.Collections.Generic.ICollection<ExcelColumn>

ExcelFilePassword

The password for the excel files.

Declaration
    public string ExcelFilePassword { get; set; }
Property Value
TypeDescription
System.String

FieldHeaders

The parsed header names from the excel

Declaration
    public string[] FieldHeaders { get; }
Property Value
TypeDescription
System.String[]

HasNoHeader

Indicates that the excel data doesn't has any header information. If set to true, the ExcelSource works best with ExpandoObject or string[] arrays as output type.

Declaration
    public bool HasNoHeader { get; set; }
Property Value
TypeDescription
System.Boolean

IgnoreBlankRows

If set to true, blank rows will be ignored. By default, the ExcelSource will stop reading after encountering the first blank row. Be careful if you don't define a range and set this to true.

Declaration
    public bool IgnoreBlankRows { get; set; }
Property Value
TypeDescription
System.Boolean

Range

The range in the excel where the data is located.

Declaration
    public ExcelRange Range { get; set; }
Property Value
TypeDescription
ExcelRange

SheetName

The sheet name from which data should be read

Declaration
    public string SheetName { get; set; }
Property Value
TypeDescription
System.String

TaskName

A name to identify the task or component. Every component or task comes with a default name that can be overwritten.

Declaration
    public override string TaskName { get; set; }
Property Value
TypeDescription
System.String
Overrides

Methods

CheckParameter()

Declaration
    protected override void CheckParameter()
Overrides
ETLBox.DataFlow.DataFlowStreamSource<TOutput>.CheckParameter()

CloseReader()

Declaration
    protected override void CloseReader()
Overrides
ETLBox.DataFlow.DataFlowStreamSource<TOutput>.CloseReader()

InitReader()

Declaration
    protected override void InitReader()
Overrides
ETLBox.DataFlow.DataFlowStreamSource<TOutput>.InitReader()

PrepareParameter()

Declaration
    protected override void PrepareParameter()
Overrides
ETLBox.DataFlow.DataFlowStreamSource<TOutput>.PrepareParameter()

ReadAllRecords()

Declaration
    protected override void ReadAllRecords()
Overrides
ETLBox.DataFlow.DataFlowStreamSource<TOutput>.ReadAllRecords()

ReadFieldHeaders(String)

Declaration
    public string[] ReadFieldHeaders(string uri = null)
Parameters
TypeNameDescription
System.Stringuri
Returns
TypeDescription
System.String[]

Implements