Class LoadFilter

Class LoadFilter

Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)

Represents the filter that provides options for loading data when loading workbook from template.

public class LoadFilter

Inheritance

objectLoadFilter

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Examples

The following example shows how to determine the filter options according to worksheet’s properties.

csharp
[C#]
LoadOptions opts = new LoadOptions();
opts.LoadFilter = new LoadFilterSheet();
Workbook wb = new Workbook("template.xlsx", opts);
//Custom LoadFilter implementation
class LoadFilterSheet : LoadFilter
{
    public override void StartSheet(Worksheet sheet) 
    {
        if (sheet.Name == "Sheet1")
        {
            LoadDataFilterOptions = LoadDataFilterOptions.All;
        }
        else
        {
            LoadDataFilterOptions = LoadDataFilterOptions.Structure;
        }
    }
}

Remarks

User may specify the filter options or implement their own LoadFilter to specify how to load data.

Constructors

LoadFilter()

Constructs one LoadFilter with default filter options LoadDataFilterOptions.All.

public LoadFilter()

LoadFilter(LoadDataFilterOptions)

Constructs one LoadFilter with given filter options.

public LoadFilter(LoadDataFilterOptions opts)

Parameters

opts LoadDataFilterOptions

the default filter options

Properties

LoadDataFilterOptions

The filter options to denote what data should be loaded.

public LoadDataFilterOptions LoadDataFilterOptions { get; set; }

Property Value

LoadDataFilterOptions

SheetsInLoadingOrder

Specifies the sheets(indices) and order to be loaded. Default is null, that denotes to load all sheets in the default order in template file. If not null and some sheet’s index is not in the returned array, then the sheet will not be loaded.

public virtual int[] SheetsInLoadingOrder { get; }

Property Value

int[]

Methods

StartSheet(Worksheet)

Prepares filter options before loading given worksheet. User’s implementation of LoadFilter can change the LoadDataFilterOptions here to denote how to load data for this worksheet.

public virtual void StartSheet(Worksheet sheet)

Parameters

sheet Worksheet

The worksheet to be loaded. There are only few properties can be used for the given worksheet object here because most data and properties have not been loaded. The available properties are: Name, Index, VisibilityType