KCellReport 0.12.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package KCellReport --version 0.12.1
                    
NuGet\Install-Package KCellReport -Version 0.12.1
                    
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="KCellReport" Version="0.12.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KCellReport" Version="0.12.1" />
                    
Directory.Packages.props
<PackageReference Include="KCellReport" />
                    
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 KCellReport --version 0.12.1
                    
#r "nuget: KCellReport, 0.12.1"
                    
#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 KCellReport@0.12.1
                    
#: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=KCellReport&version=0.12.1
                    
Install as a Cake Addin
#tool nuget:?package=KCellReport&version=0.12.1
                    
Install as a Cake Tool

CellReport

CellReport — кроссплатформенный фреймворк для создания, просмотра и экспорта табличных отчётов. Шаблоны описываются в XML (.tcr, .tcrp), данные подставляются через API секций и параметров, результат выводится на экран или экспортируется в Excel, PDF, HTML и PNG.

Поддерживаемые UI-стеки: WinForms, WPF, Avalonia. Ядро таргетит net8.0 и net48.

NuGet-пакеты

Пакет Назначение
CellReport Ядро: шаблоны, ReportDocument, экспорт, Skia-рендерер
CellReport.WinForms Просмотр и печать в WinForms
CellReport.WPF Элементы управления для WPF
CellReport.Avalonia MVVM-компоненты для Avalonia 12

Структура репозитория

CellReport/
├── src/
│   ├── CellReport/                 # ядро
│   ├── CellReport.WinForms/        # WinForms UI
│   ├── CellReport.WPF/             # WPF UI
│   ├── CellReport.Avalonia/        # Avalonia UI
│   ├── CellReport.Editor/          # редактор шаблонов (WPF)
│   ├── CellReport.Viewer/          # WinForms viewer
│   └── CellReport.Avalonia.Viewer/ # Avalonia viewer
├── tests/
│   └── Tests/                      # автоматические тесты (MSTest)
├── lib/                            # сторонние сборки
└── CellReport.sln

Быстрый старт

git clone https://github.com/Kayala-soft/CellReport.git
cd CellReport
dotnet build CellReport.sln
dotnet test tests/Tests.csproj

Примеры

1. Загрузка шаблона, заполнение данных и экспорт в PDF

Пакет: CellReport

using CellReport;
using CellReport.Export.Pdf;

// Загрузка шаблона (.tcr — XML, .tcrp — пакет)
var document = new ReportDocument(@"Templates\Invoice.tcrp");

// Секция «Строка» повторяется для каждой позиции
foreach (var item in items)
{
    document.AddSection("Строка");
    document.SetParameter("Наименование", item.Name);
    document.SetParameter("Количество", item.Qty);
    document.SetParameter("Цена", item.Price);
}

document.AddSection("Итого");
document.SetParameter("Сумма", total);

// Векторный PDF через Skia
using (var stream = File.Create(@"output\invoice.pdf"))
{
    PdfExporter.CreateVectorExporter(document.Manager).ExportTo(stream);
}

Экспорт в другие форматы:

using CellReport.Export.Excel;
using CellReport.Export.Html;
using CellReport.Export.Image;
using CellReport.Presenters.Skia;

var renderer = new SkiaReportRenderer();

using (var stream = File.Create(@"output\invoice.xlsx"))
    new ExcelExporter(document.Manager, renderer).ExportTo(stream);

using (var stream = File.Create(@"output\invoice.html"))
    new HtmlExporter(document.Manager, renderer).ExportTo(stream);

using (var stream = File.Create(@"output\invoice.png"))
    new ImageExporter(document.Manager, renderer).ExportTo(stream);

2. Просмотр отчёта в WinForms

Пакеты: CellReport, CellReport.WinForms

using CellReport;
using CellReport.Presenters.WinForms;
using System.Windows.Forms;

var document = new ReportDocument(@"Templates\Sales.tcrp");
document.AddSection("Данные");
document.SetParameter("Период", "Январь 2026");

// ReportForm содержит PresentControl с панелью инструментов
using (var form = new ReportForm())
{
    new DisplayPresenter(document.Manager, form);
    Application.Run(form);
}

Встраивание в существующую форму:


<PackageReference Include="CellReport" Version="*" />
<PackageReference Include="CellReport.WinForms" Version="*" />
var presentControl = new PresentControl();
var presenter = new DisplayPresenter(document.Manager, presentControl);
presentControl.Presenter = presenter;
Controls.Add(presentControl);

3. Avalonia: MVVM и встроенный просмотрщик

Пакеты: CellReport, CellReport.Avalonia

<PackageReference Include="CellReport" Version="*" />
<PackageReference Include="CellReport.Avalonia" Version="*" />
using CellReport;
using CellReport.Avalonia;
using CellReport.Avalonia.ViewModels;
using CellReport.Presenters;

var document = new ReportDocument(@"Templates\Stock.tcrp");
document.AddSection("Остатки");
document.SetParameter("Склад", "Основной");

var viewModel = new PresentControlViewModel(document.Manager);

<Window xmlns="https://github.com/avaloniaui"
        xmlns:cr="using:CellReport.Avalonia">
    <cr:PresentControl DataContext="{Binding ReportViewModel}" />
</Window>

PresentControlViewModel предоставляет команды экспорта (Excel, PDF, HTML, PNG), поиск, закладки, масштаб и печать (Windows).

4. WPF: встраивание в окно приложения

Пакеты: CellReport, CellReport.WPF

<PackageReference Include="CellReport" Version="*" />
<PackageReference Include="CellReport.WPF" Version="*" />
<Window xmlns:cr="clr-namespace:CellReport.Presenters.Wpf;assembly=CellReport.WPF">
    <cr:PresentControl x:Name="reportView" />
</Window>
using CellReport;
using CellReport.Presenters.Wpf;

var document = new ReportDocument(@"Templates\Order.tcr");
document.AddSection("Шапка");
document.SetParameter("Номер", orderNumber);

new DisplayPresenter(document.Manager, reportView);

5. Горизонтальное объединение секций

Пакет: CellReport

var document = new ReportDocument(templateStream);

document.AddSection("Заголовок");
document.SetParameter("Месяц", "Июнь");

document.JoinSection("Заголовок");   // вторая колонка того же ряда
document.SetParameter("Месяц", "Июль");

document.AddSection("Строка");       // новая строка
document.SetParameter("Товар", "Кабель");

Форматы шаблонов

Расширение Описание
.tcr XML-шаблон
.tcrp ZIP-пакет (шаблон + стили + ресурсы)

Редактирование: проект CellReport.Editor в src/ или визуальный редактор из дистрибутива.

Сборка и тесты

# всё решение
dotnet build CellReport.sln

# только ядро
dotnet build src/CellReport/CellReport.csproj

# тесты
dotnet test tests/Tests.csproj

Лицензия

MIT © Daniil Safonov

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on KCellReport:

Package Downloads
KCellReport.Avalonia

CellReport для Avalonia 12: MVVM-компоненты просмотра и экспорта отчётов

KCellReport.WinForms

CellReport для WinForms: просмотр, печать и GDI+-рендерер

Kayala

Kayala — framework for building trade automation systems. Includes template engine, localization, print forms, scheduling, data exchange and UI abstractions.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.13.1 50 8/23/2026
0.13.0 62 8/21/2026
0.12.1 140 6/15/2026
0.12.0 140 6/15/2026
0.11.2605.311 140 6/14/2026