KCellReport 0.13.1
dotnet add package KCellReport --version 0.13.1
NuGet\Install-Package KCellReport -Version 0.13.1
<PackageReference Include="KCellReport" Version="0.13.1" />
<PackageVersion Include="KCellReport" Version="0.13.1" />
<PackageReference Include="KCellReport" />
paket add KCellReport --version 0.13.1
#r "nuget: KCellReport, 0.13.1"
#:package KCellReport@0.13.1
#addin nuget:?package=KCellReport&version=0.13.1
#tool nuget:?package=KCellReport&version=0.13.1
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.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 | Versions 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. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- mustache-sharp (>= 1.0.0)
- Nut (>= 4.0.0)
- SkiaSharp (>= 3.116.1)
- System.IO.Packaging (>= 9.0.1)
- Topten.RichTextKit (>= 0.4.167)
- ZXing.Net (>= 0.16.10)
- ZXing.Net.Bindings.SkiaSharp (>= 0.16.21)
-
net10.0
- mustache-sharp (>= 1.0.0)
- Nut (>= 4.0.0)
- SkiaSharp (>= 3.116.1)
- System.IO.Packaging (>= 9.0.1)
- Topten.RichTextKit (>= 0.4.167)
- ZXing.Net (>= 0.16.10)
- ZXing.Net.Bindings.SkiaSharp (>= 0.16.21)
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 | 40 | 8/23/2026 |
| 0.13.0 | 56 | 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 |