ExcelBinaryReaderOptions Class
Definition
- Assembly
- Bodu.Formats.Excel.Binary.dll
- Package
- Bodu.Formats.Excel.Binary 1.0.0
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
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
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
| Product | Versions |
|---|---|
| .NET | 8, 10 |