VOOZH about

URL: https://www.nuget.org/packages/MeshWeaver.DataSetReader.Excel.BinaryFormat/

⇱ NuGet Gallery | MeshWeaver.DataSetReader.Excel.BinaryFormat 2.5.0




MeshWeaver.DataSetReader.Excel.BinaryFormat 2.5.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package MeshWeaver.DataSetReader.Excel.BinaryFormat --version 2.5.0
 
 
NuGet\Install-Package MeshWeaver.DataSetReader.Excel.BinaryFormat -Version 2.5.0
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MeshWeaver.DataSetReader.Excel.BinaryFormat" Version="2.5.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MeshWeaver.DataSetReader.Excel.BinaryFormat" Version="2.5.0" />
 
Directory.Packages.props
<PackageReference Include="MeshWeaver.DataSetReader.Excel.BinaryFormat" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MeshWeaver.DataSetReader.Excel.BinaryFormat --version 2.5.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MeshWeaver.DataSetReader.Excel.BinaryFormat, 2.5.0"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MeshWeaver.DataSetReader.Excel.BinaryFormat@2.5.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MeshWeaver.DataSetReader.Excel.BinaryFormat&version=2.5.0
 
Install as a Cake Addin
#tool nuget:?package=MeshWeaver.DataSetReader.Excel.BinaryFormat&version=2.5.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

MeshWeaver.DataSetReader.Excel.BinaryFormat

MeshWeaver.DataSetReader.Excel.BinaryFormat is a specialized implementation for reading legacy Excel (.xls) files in the BIFF (Binary Interchange File Format) format. It provides comprehensive support for reading Excel 97-2003 workbooks with their complex binary structure.

Overview

The library provides:

  • Complete BIFF format support
  • Excel 97-2003 workbook reading
  • Cell format handling
  • Shared string table support
  • Multi-sheet workbook handling
  • Formula cell support

Architecture

Core Components

ExcelBinaryReader

Main reader implementation providing:

  • Workbook structure parsing
  • Sheet content reading
  • Cell value extraction
  • Format conversion
BIFF Record Types

Specialized handlers for various BIFF records:

  • BOF (Beginning of File)
  • Worksheet data
  • Cell content
  • Formatting information
  • Shared strings
  • Formula cells

Binary Format Support

Workbook Structure
  • File header parsing
  • Workbook globals
  • Sheet information
  • Format definitions
  • Font tables
Cell Types
  • Label cells
  • Number cells
  • Formula cells
  • Blank cells
  • Error cells
  • Boolean cells

Usage Examples

Basic File Reading

public async Task<IDataSet> ReadXlsFile(Stream stream)
{
 var reader = new ExcelBinaryReader();
 reader.Initialize(stream);
 
 var dataSet = new DataSet();
 while (reader.Read())
 {
 // Process rows
 for (int i = 0; i < reader.FieldCount; i++)
 {
 var value = reader.GetValue(i);
 // Handle cell value
 }
 }
 
 return dataSet;
}

Configuring Reader Options

var reader = new ExcelBinaryReader(new ReadOption
{
 IsFirstRowAsColumnNames = true,
 ConvertOADates = true
});

Reading Multiple Sheets

public DataSet ReadAllSheets(Stream stream)
{
 using var reader = new ExcelBinaryReader();
 reader.Initialize(stream);
 
 var dataSet = new DataSet();
 do
 {
 var table = new DataTable(reader.Name);
 // Read sheet data into table
 dataSet.Tables.Add(table);
 } while (reader.NextResult());
 
 return dataSet;
}

Advanced Features

Shared String Handling

private void HandleSharedStrings(XlsBiffSST sst)
{
 // SST (Shared String Table) processing
 foreach (var str in sst.StringList)
 {
 // Process shared string
 }
}

Format Conversion

private object ConvertCellValue(XlsBiffRecord cell, ushort format)
{
 // Handle various Excel formats
 switch (format)
 {
 case FormatType.Date:
 return TryConvertOADateTime(cell.Value);
 case FormatType.Number:
 return ConvertNumber(cell.Value);
 // ... other formats
 }
}

BIFF Record Types

Core Records

  • BOF (Beginning of File)
  • EOF (End of File)
  • BOUNDSHEET (Worksheet Information)
  • SST (Shared String Table)
  • FORMAT (Number Format)
  • XF (Extended Format)

Cell Records

  • LABEL (String Cell)
  • NUMBER (Numeric Cell)
  • FORMULA (Formula Cell)
  • BLANK (Empty Cell)
  • MULBLANK (Multiple Empty Cells)
  • RK (RK Number Cell)

Best Practices

  1. Memory Management

    • Use streaming for large files
    • Dispose readers properly
    • Handle large string tables efficiently
  2. Format Handling

    • Validate cell formats
    • Handle date conversions properly
    • Support custom number formats
  3. Error Handling

    • Check file corruption
    • Handle formula errors
    • Validate record sequences
  4. Performance

    • Use appropriate buffer sizes
    • Cache shared strings
    • Optimize cell access

Integration

With Base Excel Reader

public class BinaryFormatReader : ExcelDataSetReaderBase
{
 protected override IExcelDataReader GetExcelDataReader(Stream stream)
 {
 var reader = new ExcelBinaryReader();
 reader.Initialize(stream);
 return reader;
 }
}

With Message Hub

services.AddMessageHub(hub => hub
 .ConfigureServices(services => services
 .AddSingleton<IExcelReaderFactory>(provider => 
 new ExcelReaderFactory())
 .AddTransient<IDataSetReader, BinaryFormatReader>()
 )
);

Error Handling

The library provides detailed error information for:

  • Invalid file formats
  • Corrupted records
  • Unsupported features
  • Formula errors
  • Format conversion issues

Related Projects

  • MeshWeaver.DataSetReader.Excel - Base Excel reader framework
  • MeshWeaver.DataSetReader.Excel.OpenXmlFormat - Modern Excel format implementation
  • MeshWeaver.DataStructures - Core data structures
Product Versions Compatible and additional computed target framework versions.
.NET net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MeshWeaver.DataSetReader.Excel.BinaryFormat:

Package Downloads
MeshWeaver.DataSetReader.Excel

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-preview1 123 4/16/2026
2.5.0 255 11/3/2025
2.4.0 224 10/2/2025
2.3.0 267 8/4/2025
2.2.0 555 7/21/2025
2.1.0 222 4/6/2025
2.0.3 572 3/24/2025
2.0.2 525 3/24/2025
2.0.1 194 3/21/2025
2.0.0 223 3/20/2025
2.0.0-preview3 152 2/28/2025
2.0.0-Preview2 174 2/10/2025
2.0.0-preview1 162 1/6/2025
1.0.1 210 10/8/2024
1.0.0 195 10/8/2024