Table of Contents

ExcelBinaryReaderOptions Class

Definition

Namespace
Bodu.Formats.Excel
Assembly
Bodu.Formats.Excel.Binary.dll
Package
Bodu.Formats.Excel.Binary 1.0.0
Source
ExcelBinaryReaderOptions.cs

Controls how an ExcelBinaryWorkbook opens and reads a workbook, allowing callers to trade optional metadata work for throughput and to govern stream ownership.

public sealed class ExcelBinaryReaderOptions
Inheritance
ExcelBinaryReaderOptions
Inherited Members
Extension Methods

Remarks

The defaults read the full metadata surface (document properties and date-format detection) and dispose a caller-supplied stream with the workbook. For a numeric, time-series workload - where only row, column, and numeric value matter - clearing ReadDocumentProperties and DetectDateFormats skips the property sets and number-format interpretation.

using Bodu.Formats.Excel;

var options = new ExcelBinaryReaderOptions
{
    LeaveOpen = true,               // do not dispose the caller's stream
    ReadDocumentProperties = false, // skip the summary-information property sets
    DetectDateFormats = false,      // skip number-format classification
};

using var source = File.OpenRead("data.xls");
using var workbook = ExcelBinaryWorkbook.Open(source, options);

Constructors

ExcelBinaryReaderOptions()

public ExcelBinaryReaderOptions()

Properties

DetectDateFormats

Gets a value indicating whether the number format of each numeric cell is inspected to detect date formatting.

public bool DetectDateFormats { get; init; }

Property Value

bool

true to classify date-formatted numbers; false to skip the classification, leaving IsDateFormatted always false. The default is true.

LeaveOpen

Gets a value indicating whether a caller-supplied stream is left open when the workbook is disposed.

public bool LeaveOpen { get; init; }

Property Value

bool

true to leave the source stream open; false to dispose it with the workbook. The default is false.

ReadDocumentProperties

Gets a value indicating whether the workbook's document-property sets are read when opening.

public bool ReadDocumentProperties { get; init; }

Property Value

bool

true to read the summary-information property sets; false to skip them and surface an empty ExcelWorkbookProperties. The default is true.

Applies to

ProductVersions
.NET8, 10