Enum LoadDataFilterOptions

LoadDataFilterOptions enumeration

Represents the options to filter data when loading workbook from template.

public enum LoadDataFilterOptions

Values

NameValueDescription
None0Load nothing for sheet data
All2147483647Load all
CellBlank1Load cells whose value is blank
CellString2Load cells whose value is string
CellNumeric4Load cells whose value is numeric(including datetime)
CellError8Load cells whose value is error
CellBool16Load cells whose value is bool
CellValue31Load cells value(all value types) only
Formula32Load cell formulas.
CellData67108927Load cells data including values, formulas and formatting
Chart256Load charts
Shape402653696Load shapes
Drawing402653952Drawing objects(including Chart, Picture, OleObject and all other drawing objects)
MergedArea1024Load merged cells
ConditionalFormatting2048Load conditional formatting
DataValidation4096Load data validations
PivotTable8192Load pivot tables
Table16384Load tables
Hyperlinks32768Load hyperlinks
SheetSettings65536Load settings for worksheet
SheetData403701759Load all data of worksheet, such as cells data, settings, objects, …etc.
BookSettings1048576Load settings for workbook
Settings1114112Load settings for workbook and worksheet
XmlMap2097152Load XmlMap
Structure4194304Load structure of the workbook
DocumentProperties8388608Load document properties
DefinedNames16777216Load defined Name objects
VBA33554432Load VBA projects
Style67108864Load styles for cell formatting
Picture134217728Load pictures
OleObject268435456Load OleObjects
Revision536870912Load revision logs

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using System;

    public class LoadDataFilterOptionsDemo
    {
        public static void LoadDataFilterOptionsExample()
        {
            // Create a new LoadOptions instance
            LoadOptions loadOptions = new LoadOptions();

            // Create a custom LoadFilter implementation
            loadOptions.LoadFilter = new CustomLoadFilter();

            // Load the workbook with the specified load options
            Workbook workbook = new Workbook("LoadDataFilterOptionsExample_original.xlsx", loadOptions);

            // Save the workbook to verify the loaded data
            workbook.Save("LoadDataFilterOptionsExample.xlsx");
        }

        // Custom LoadFilter implementation
        private class CustomLoadFilter : LoadFilter
        {
            public override void StartSheet(Worksheet sheet)
            {
                // Apply different filter options based on the sheet name
                if (sheet.Name == "Sheet1")
                {
                    LoadDataFilterOptions = LoadDataFilterOptions.All;
                }
                else
                {
                    LoadDataFilterOptions = LoadDataFilterOptions.Structure;
                }
            }
        }
    }
}

See Also