Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ExcelReaderOptions

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Source revision
e163ccb36643 with working tree changes
Modifiers
sealed

Reading options controlling conversion behavior and execution policy.

Inheritance

  • object
  • ExcelReaderOptions

Usage

Explore 27 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 1

Accepted by parameters 26

Constructors

public ExcelReaderOptions() #

Initializes reading defaults and per-operation thresholds.

Methods

public ExcelReaderOptions Clone() #

Creates an independent options snapshot, including culture and execution thresholds. Converter and diagnostic delegates retain their caller-owned behavior.

Properties

public string? Password { get; set; } #

Password used when opening an encrypted workbook.

public ExcelLoadOptions? Transport { get; set; } #

HTTP admission and transport settings for URI reader sources.

public string? SheetName { get; set; } #

Gets or sets the worksheet exposed by ExcelDocument.OpenReader. When omitted, worksheets are exposed in workbook order through DbDataReader.NextResult.

public int? SheetIndex { get; set; } #

Gets or sets the zero-based worksheet index exposed by an Excel data reader. Cannot be combined with ExcelReaderOptions.SheetName.

public string? A1Range { get; set; } #

Gets or sets an optional A1 range exposed from each selected worksheet. When omitted, the worksheet used range is exposed.

public bool HasHeaderRow { get; set; } #

Gets or sets whether the first row supplies column names.

public bool InferSchema { get; set; } #

Gets or sets whether the data-reader schema is inferred from worksheet values. Native cell values are preserved regardless of this setting.

public bool EnableWorksheetPrefetch { get; set; } #

Gets or sets whether the selected XLSX worksheet should be decompressed on a background worker while workbook metadata is parsed. The default is false.

public int SchemaSampleRows { get; set; } #

Gets or sets the maximum rows sampled when schema inference is enabled.

public long MaxInputBytes { get; set; } #

Maximum workbook bytes buffered by the Excel reader APIs. Default: 512 MiB.

public int MaxWorksheets { get; set; } #

Maximum worksheet definitions accepted while reading workbook metadata. Default: 16,384.

public int MaxMetadataPartBytes { get; set; } #

Maximum decompressed bytes accepted from one workbook metadata part. Default: 16 MiB. Worksheet data, shared strings, and styles retain their format-specific limits.

public int MaxDataReaderColumns { get; set; } #

Maximum columns exposed by one range data reader.

public int MaxDataReaderChunkRows { get; set; } #

Maximum worksheet rows materialized in one data-reader chunk.

public int MaxDataReaderSchemaSampleRows { get; set; } #

Maximum rows retained for data-reader schema inference.

public long MaxDataReaderBufferedCells { get; set; } #

Maximum cells materialized by a data-reader chunk or schema sample.

public long MaxXmlDataReaderBufferedCharacters { get; set; } #

Maximum decoded characters charged during XML data-reader preparation or streaming in one physical row, or across all buffered out-of-order rows. Default: 32 Mi characters.

public int MaxXlsbCells { get; set; } #

Maximum populated cell records accepted across one XLSB workbook. Default: 4,000,000. This is an aggregate safety limit, independent of per-chunk data-reader buffering.

public int MaxXlsbLogicalRows { get; set; } #

Maximum logical rows emitted across one XLSB workbook data-reader operation. Default: 1,048,576. Sparse row gaps consume this aggregate budget just like populated rows.

public long MaxRangeCells { get; set; } #

Maximum cells materialized by one dense range read. Default: 1,000,000.

public int MaxPendingTypedRows { get; set; } #

Maximum out-of-order rows retained by one typed streaming read. Default: 8,192.

public ExcelExecutionPolicy Execution { get; private set; } #

Execution policy used to decide Sequential vs Parallel conversion. Reuses the writer-side policy for symmetry.

public bool UseCachedFormulaResult { get; set; } #

Use cached formula results when present; otherwise returns the formula string.

public bool TreatDatesUsingNumberFormat { get; set; } #

Interpret numeric cells with a date-like number format as DateTime. Calendar formats use the workbook date system; time-only and elapsed formats use OLE Automation dates as a carrier for the unshifted time serial.

public CultureInfo Culture { get; set; } #

Culture used when parsing numbers and dates stored as strings.

public CancellationToken CancellationToken { get; set; } #

Cancellation observed while opening and streaming workbook data.

public bool FillBlanksInRanges { get; set; } #

When true, matrix/range readers fill unspecified cells with nulls.

public bool NormalizeHeaders { get; set; } #

Normalize headers for object mapping by trimming and collapsing whitespace.

public bool NumericAsDecimal { get; set; } #

When true, numeric cells are returned as decimal where possible; otherwise double is used.

public bool InferDataTableColumnTypes { get; set; } #

When true, DataTable reads infer stable column types from the materialized range. Mixed-type columns stay object-typed.

public bool StrictTypedMapping { get; set; } #

When true, typed object readers throw if selected headers cannot be mapped deterministically to writable properties.

public Func<ExcelCellContext, ExcelCellValue>? CellValueConverter { get; set; } #

Optional cell-level converter hook. If provided and it returns a handled value, the built-in conversion pipeline is skipped and the returned value is used.

public Func<object, Type, CultureInfo, ValueTuple<bool, object?>>? TypeConverter { get; set; } #

Optional type conversion hook used by typed readers (ReadColumnAs/ReadRowsAs/ReadRangeAs and object mapping). If it returns ok=true, its value is used; otherwise the built-in converter is used.

public DataMappingErrorValuePolicy MappingErrorValuePolicy { get; set; } #

Gets or sets whether typed mapping failures may include source values. Defaults to DataMappingErrorValuePolicy.Include for compatibility.

public int MaxSharedStringItems { get; set; } #

Maximum number of entries loaded from the workbook shared-string table. This protects readers from malformed workbooks that advertise or contain unbounded shared-string tables.

public int MaxSharedStringItemCharacters { get; set; } #

Maximum character length for one shared-string item. The default matches Excel's worksheet cell text limit.

public long MaxSharedStringCharacters { get; set; } #

Maximum aggregate characters loaded from the shared-string table.