VelocityExcel 1.0.9

dotnet add package VelocityExcel --version 1.0.9
                    
NuGet\Install-Package VelocityExcel -Version 1.0.9
                    
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="VelocityExcel" Version="1.0.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VelocityExcel" Version="1.0.9" />
                    
Directory.Packages.props
<PackageReference Include="VelocityExcel" />
                    
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 VelocityExcel --version 1.0.9
                    
#r "nuget: VelocityExcel, 1.0.9"
                    
#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 VelocityExcel@1.0.9
                    
#: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=VelocityExcel&version=1.0.9
                    
Install as a Cake Addin
#tool nuget:?package=VelocityExcel&version=1.0.9
                    
Install as a Cake Tool

VelocityExcel

Ultra-high-speed. Ultra-low memory. Zero compromise. Enterprise ready.

NuGet Downloads Docs Website


Benchmark Summary (BenchmarkDotNet)

Library Read Write Read Time Write Time
🏆 VelocityExcel (Fastest) 27.68 s 2.853 s
MiniExcel 42.20 s 11.551 s
SwiftExcel ❌ Not supported 7.581 s

Dataset

  • Read: 30 columns, 1,000,001 rows including header
  • Write: 13 columns, 1,000,000 rows

Note:
SwiftExcel does not support reading Excel files.

  • Benchmarks were run using BenchmarkDotNet on .NET 6.0.
  • Results represent mean time with 99.9% confidence intervals.
  • Read benchmark: N = 30 iterations per test.
  • Write benchmark: N = 30 iterations per test.
  • Results may vary depending on hardware, dataset shape, and usage patterns.
  • VelocityExcel showed the best performance in both read and write scenarios.
  • VelocityExcel uses significantly less memory than alternatives at large scale.

[1.1.0] - Upcoming

Added

  • Support parsing formulas from worksheets.
  • Support complex nested formulas.
  • Read computed results from formulas (no Excel installation required).
  • Ability to write formulas to cells.

Notes

  • Formula recalculation is not automatic when writing
  • Formulas are evaluated when read or explicitly processed
  • No Excel installation required on server or client

📢 Latest Update

v1.0.9 - Improved third-party/vendor Excel compatibility + DateTime rounding + massive-scale write performance

🚀 1,000,000 rows × 13 columns in under 2.85 seconds(write)
🚀 1,000,000 rows × 29 columns in under 5.72 seconds(write)

This release delivers unprecedented performance for massive Excel file processing, making it ideal for enterprise-scale exports, ETL pipelines, and big data scenarios.

✨ New in v1.0.9

  • Added SkipRows(int) support to the streaming worksheet writer
  • Developers can now explicitly advance the current worksheet row by writing an empty row
  • Added SkipColumns(int) support to the streaming worksheet writer
  • Developers can now explicitly skip one or more leading columns before writing the next row
  • This makes sparse row layouts and precise cell positioning easier without inserting placeholder
  • Improved date/time parsing for more vendor-generated Excel files
  • Added DateTime rounding support for ExcelReader
  • Developers can now get correctly rounded Excel date/time values more easily
  • Full raw DateTime precision remains available for custom formatting

DateTime Rounding

Excel stores date/time values with fractional seconds. In some cases, developers may want the value rounded to the nearest second to better match Excel-style display behavior.

For example, a value like:

2025-05-04 18:26:23.892

can be rounded to:

2025-05-04 18:26:24

If someone does not want to use built-in DateTime rounding, they can still format and round manually like this:

if (cell is DateTime dt)
{
    Console.WriteLine(dt.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture));
    Console.WriteLine(dt.ToString("MM/dd/yyyy HH:mm:ss.fff", CultureInfo.InvariantCulture));
    Console.WriteLine(dt.ToString("dd/MM/yyyy HH:mm:ss.fff", CultureInfo.InvariantCulture));

    DateTime roundedDateTime = dt.AddMilliseconds(500);
    roundedDateTime = new DateTime(
        roundedDateTime.Year,
        roundedDateTime.Month,
        roundedDateTime.Day,
        roundedDateTime.Hour,
        roundedDateTime.Minute,
        roundedDateTime.Second,
        0,
        roundedDateTime.Kind);

    Console.WriteLine("Original DateTime: " + dt.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture));
    Console.WriteLine("Rounded DateTime: " + roundedDateTime.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture));
}

Why this matters

  • Better alignment with how Excel often displays date/time values
  • More developer-friendly date handling
  • Flexible behavior for both exact precision and rounded output

🔓 Full XLSX Compatibility

Fully compatible with the OpenXML XLSX specification. Reads files generated by Microsoft Excel and other vendor libraries.

VelocityExcel is a high-performance, ultra-fast streaming Excel (XLSX) reader and writer for .NET with minimal memory footprint. Built for processing massive files efficiently without loading them entirely into memory.


📦 Installation

dotnet add package VelocityExcel

📚 Documentation

Full API documentation is available here:

👉 https://naskaz.github.io/fluentconsole.github.io/docs/velocityexcel/index.html


✍️ ExcelWriter

✔ Features

  • ✔ Blazing Fast Performance
  • ✔ Minimal GC Pressure
  • ✔ Predictable Memory
  • ✔ Excellent Compression
  • ✔ Culture-Aware Formatting
  • ✔ Thread-Safe Design
  • ✔ Zero External Dependencies
  • ✔ Massive Scale

Why Use VelocityExcel for Writing?

  • Production-Proven Performance
  • Streaming Architecture
  • Configurable Output
  • Simple Fluent API
  • Enterprise-Ready

Usage Examples

Basic Excel File Creation

using VelocityExcel.Api;

using (var writer = new ExcelWriter("output.xlsx"))
{
    using (var sheet = writer.CreateWorksheet("Employees"))
    {
        sheet.WriteRow("ID", "Name", "Department", "Salary", "Hire Date", "Is Active");

        sheet.WriteRow(1, "John Doe", "Engineering", 75000.50, new DateTime(2020, 3, 15), true);
        sheet.WriteRow(2, "Jane Smith", "Marketing", 82000.00, new DateTime(2019, 7, 22), true);
        sheet.WriteRow(3, "Bob Johnson", "Sales", 65000.00, new DateTime(2021, 1, 10), false);
        sheet.WriteRow(4, "Alice Brown", "Engineering", 91000.00, new DateTime(2018, 11, 5), true);
    }

    using (var sheet = writer.CreateWorksheet("Departments"))
    {
        sheet.WriteRow("Department", "Manager", "Budget");
        sheet.WriteRow("Engineering", "Alice Brown", 500000);
        sheet.WriteRow("Marketing", "Jane Smith", 350000);
        sheet.WriteRow("Sales", "Bob Johnson", 400000);
    }

    writer.Close();
}

Configured Output with ExcelOptions

using VelocityExcel.Api;

var options = new ExcelOptions
{
    CompressionPreset = "Fastest",
    PrettyPrintXml = false,
    UseSharedStrings = false,
};

using (var writer = new ExcelWriter("configured_output.xlsx", options))
{
    using (var sheet = writer.CreateWorksheet("Products"))
    {
        sheet.WriteRow("Product ID", "Name", "Price", "In Stock", "Last Updated");

        for (int i = 1; i <= 1000; i++)
        {
            sheet.WriteRow(
                i,
                $"Product {i}",
                19.99 + (i * 0.01),
                i % 3 == 0,
                DateTime.Now.AddDays(-i)
            );
        }
    }
}

✅ Ideal for:

  • Large data exports
  • Background services
  • Web API downloads
  • ETL pipelines
  • Real-time structured logging

📖 ExcelReader

✔ Features

  • ✔ Blazing Fast Performance
  • ✔ Compatible with Microsoft Excel and third-party/vendor XLSX files
  • ✔ Forward-Only Streaming
  • ✔ Precise Type Detection
  • ✔ Format-Aware Parsing
  • ✔ Safe XML Processing
  • ✔ Shared String Deduplication
  • ✔ Worksheet Navigation
  • ✔ Zero External Dependencies

Why Use VelocityExcel for Reading?

  • Robust Format Handling
  • Culture-Aware Parsing
  • Memory-Efficient Streaming

Usage Examples

Simple Excel Reader Example

using VelocityExcel.Api;

using (var reader = new ExcelReader("sample.xlsx"))
{
    Console.WriteLine("Worksheets found:");
    foreach (var name in reader.WorksheetNames)
        Console.WriteLine($"  - {name}");

    using (var worksheet = reader.OpenWorksheet(0))
    {
        int rowCount = 0;

        foreach (var row in worksheet.ReadRows())
        {
            rowCount++;

            Console.Write($"Row {rowCount}: ");

            for (int i = 0; i < Math.Min(3, row.Length); i++)
                Console.Write($"[{row[i]?.ToString() ?? "NULL"}] ");

            if (row.Length > 3)
                Console.Write("...");

            Console.WriteLine();
        }

        Console.WriteLine($"\nTotal rows read: {rowCount}");
    }
}

Read by Worksheet Name

using VelocityExcel.Api;

using (var reader = new ExcelReader("data.xlsx"))
{
    if (reader.TryOpenWorksheet("Sheet1", out var worksheet))
    {
        using (worksheet)
        {
            foreach (var row in worksheet.ReadRows())
            {
                if (row.Length > 0)
                {
                    var id = row[0];
                    var name = row[1];
                    var value = row[2];

                    Console.WriteLine($"ID: {id}, Name: {name}, Value: {value}");
                }
            }
        }
    }
}

🎯 Use Cases (Perfect Fit)

VelocityExcel is designed for any .NET application that needs to process large Excel files efficiently. Its streaming architecture and minimal memory footprint make it particularly suitable for:

🌐 Web Applications

  • ASP.NET Core Web APIs - Stream Excel files directly to HTTP responses without buffering
  • ASP.NET MVC / Razor Pages - Generate reports with FileResult actions
  • Blazor Server - Export data with real-time progress reporting
  • Blazor WebAssembly - Client-side Excel generation
  • REST APIs - Serve Excel data as streaming responses

🖥️ Desktop Applications

  • Windows Forms - Background Excel generation without freezing UI
  • WPF - Async/await pattern for responsive exports
  • .NET MAUI - Cross-platform Excel processing

⚙️ Background & Cloud Services

  • Worker Services - Scheduled report generation, for example daily sales reports
  • Azure Functions - Serverless ETL pipelines with consumption plan
  • AWS Lambda - Memory-efficient Excel processing, fits in 128MB lambdas
  • Windows Services - Long-running automation tasks

🔧 Development & DevOps

  • CLI Tools - Command-line Excel processors for automation
  • CI/CD Pipelines - Generate test reports and data validation outputs
  • ETL Scripts - Data transformation and aggregation
  • Database Exports - Large-scale data extraction to Excel

🐳 Containerized & Microservices

  • Docker Containers - Minimal memory footprint, tested at under 10 MB for 1M rows
  • Kubernetes - Predictable resource usage for scaling
  • Service Fabric - Reliable background processing

📄 License

VelocityExcel is proprietary software.

You are granted a royalty-free, non-exclusive license to use the software in commercial and non-commercial applications, including distribution as part of compiled applications.

Redistribution as a standalone library, NuGet package, or source distribution is not permitted.

Refer to the LICENSE file for full terms.


🙏 Show Your Support

If you find VelocityExcel useful:

  • 📢 Share it
  • 🛠️ Submit feedback
  • 🐛 Report issues

Built with performance, safety, and simplicity in mind. 🎯

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.