GKit.Reporting 1.0.0

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

GKit.Reporting

The library provide an extension method to the type IEnumerable<T> which produces a CSV string.

string csv = items.ToCsvString(b =>
    b.AddColumn("Number", p => p.Num)
    .AddColumn("Date", p => p.DateNow.ToString("dd/MM/yyyy HH:mm"))
    .AddColumn("Tit", p => p.Title));

XLSX reports

XlsReporter<T> writes a header row and one row per item, each value in its native cell type so Excel formats numbers and dates in the reader's locale rather than the server's.

var descriptors = new DescriptorsBuilder<Movement>()
    .Column("Codice", p => p.Code)
    .Column("Quantita", p => p.Quantity, "#,##0.00")   // Excel number format, per column
    .Column("Data", p => p.Date)
    .Build();

await new XlsReporter<Movement>("Movimenti", descriptors).WriteReportAsync(data, stream);

Styling without a subclass

XlsStyleOptions<T> is the third constructor argument. It carries a XlsTheme for the look of the whole sheet, an optional per-cell Resolve for the exceptions, and a PostProcess hook that runs against the finished sheet.

var styles = new XlsStyleOptions<Movement>
{
    Theme = XlsTheme.Default with
    {
        FontFamily = "Calibri",
        FontSize = 10,
        HeaderBackground = IndexedColors.Grey25Percent,
    },

    // Runs per cell. Return null to keep the style the theme gives it.
    Resolve = ctx => ctx is { Role: XlsCellRole.Data, Value: decimal and < 0 }
        ? new XlsCellStyle("negative", wb => wb.CreateCellStyle()
            .WithFont(wb.CreateFont().FontStyle("Calibri", 10).Color(IndexedColors.Red))
            .BorderStyle(BorderStyle.Thin))
        : null,

    PostProcess = (workbook, sheet) => sheet.CreateFreezePane(0, 1),
};

await new XlsReporter<Movement>("Movimenti", descriptors, styles).WriteReportAsync(data, stream);

Two things the design turns on:

  • An options object holds recipes, never an ICellStyle. A style belongs to the workbook that created it, so one built ahead of time cannot be used by a second render. That is what makes an options object safe to build once and share — a DI singleton, a static, a [Parameter].
  • A resolved style is named, and the name is its cache key. Returning the same key for a thousand cells creates one style, not a thousand: xlsx caps a workbook at roughly 64k cell styles, which a per-cell style reaches on an export of any size.

The Get*Style methods stay protected virtual for a reporter that is a type of its own — XlsGroupingReporter<T> is one — and a resolver takes precedence over them where it returns something. Grid exports reach all of this through GKit.UI.Data's ToXlsAsync and the grids' ExportStyles parameter.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on GKit.Reporting:

Package Downloads
GKit.MudBlazorExt

Set of MudBlazor extensnions

GKit.UI.Data

UI-neutral EF Core grid, CRUD and export engine shared by the GKit UI adapters

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 9/23/2026
0.0.15 94 9/11/2026
0.0.14 118 9/1/2026
0.0.13 97 8/31/2026
0.0.12 153 6/24/2026
0.0.11 120 5/2/2026
0.0.10 127 4/3/2026
0.0.9 130 3/26/2026
0.0.8 159 1/30/2026
0.0.7 401 11/17/2025
0.0.6 259 10/28/2025
0.0.5 248 9/30/2025
0.0.4 257 7/11/2025
0.0.3 364 5/12/2025