FlexCel Studio for .NET
This skill helps write C# / VB.NET / F# code that uses FlexCel — the TMS Software library for working with Excel .xlsx / .xls files, exporting to PDF / HTML / SVG / images, and generating data-driven reports from templates. Works with .NET Framework 4.6+, .NET Core / .NET 5+, .NET Standard 2.0+, .NET MAUI, Xamarin, and .NET 9 Native AOT (with caveats — see below).
When to use this skill
Activate whenever the user wants to, from .NET code:
- Read an Excel file (
.xlsx or .xls) — cell values, formulas, formatting.
- Create or modify an Excel file programmatically.
- Generate reports by merging data into Excel templates.
- Export an Excel file to PDF, HTML, SVG, or images.
- Autofit rows/columns, render sheets, or measure cells.
- Target .NET Framework, .NET Core / .NET 5+, .NET MAUI, Xamarin, Blazor server, ASP.NET Core, or Native AOT.
FlexCel does not require Excel or any Office installation on the target machine. No OLE/COM, no interop. Fully managed — works on Windows, Linux, macOS, iOS, and Android.
Two ways to create Excel files — pick one
Before writing code, decide which API fits the task:
| If the user wants to… |
Use |
Why |
| Read existing files, or build files cell-by-cell in code |
XlsFile API (FlexCel.XlsAdapter) |
Full programmatic control; no designer required; Native-AOT-safe. |
| Produce the same report repeatedly from changing data, with a styled layout |
FlexCelReport + Excel template (FlexCel.Report) |
Non-programmers can edit the template in Excel; code only provides data. |
When the user says "generate a report with company logo / nice formatting / many rows from a database", prefer Reports. When they say "read this file and extract values" or "create an Excel file with these calculations", prefer the API.
You can combine both: run a report to produce an in-memory XlsFile, then manipulate it with the API, then export to PDF.
Package and namespace reference
NuGet package: TMS.FlexCel (includes almost all functionality). Install via dotnet add package TMS.FlexCel after configuring the TMS NuGet source — FlexCel is hosted at TMS's own NuGet feed, not on nuget.org. See guides/installation-guide.md in the doc source for feed setup.
Optional companion packages:
TMS.FlexCel.WinForms — WinForms preview / grid components.
TMS.FlexCel.WebForms — legacy WebForms viewer (rarely needed).
Namespaces — add per task:
| Task |
using |
| Any FlexCel code |
using FlexCel.Core; |
| Read / write xls/xlsx |
using FlexCel.XlsAdapter; |
| PDF / HTML / image export, autofitting |
using FlexCel.Render; |
| Low-level PDF access (sign, PDF/A, standalone PDF) |
using FlexCel.Pdf; |
| Template-based reports |
using FlexCel.Report; |
| WinForms components |
using FlexCel.Winforms; |
| ASP.NET helpers |
using FlexCel.AspNet; |
Note: Unlike the VCL edition, .NET has no platform-support unit/assembly to register in the entry point — all platform integration ships with the core package. Just reference TMS.FlexCel and you're done.
Critical gotchas (read this every time)
- 1-based indexing for rows, columns, and sheets.
xls.SetCellValue(1, 1, ...) writes to A1. XF (format) indices are the single exception — they are 0-based.
- No
T prefix on class names. VCL has TXlsFile, TFlexCelReport, TFlexCelPdfExport. .NET has XlsFile, FlexCelReport, FlexCelPdfExport. However value-type structs keep the T — TFormula, TFlxFormat, TCellAddress, TRichString, TExcelFileFormat, TFlxFormulaErrorValue.
GetCellValue returns object. There is no TCellValue discriminated union in .NET. Dispatch with is pattern matching:if (cell == null) { /* empty */ }
else if (cell is string s) { /* plain text */ }
else if (cell is TRichString rs) { /* rich text */ }
else if (cell is double d) { /* number (dates too!) */ }
else if (cell is bool b) { /* boolean */ }
else if (cell is TFlxFormulaErrorValue) { /* #DIV/0 etc. */ }
else if (cell is TFormula f) { /* formula */ }
- Never iterate with
ColCount — it scans the whole sheet. Use ColCountInRow(row) + GetCellValueIndexed(row, colIdx, ref XF) + ColFromIndex(row, colIdx) — this is sparse-aware and dramatically faster on real files.
- Dates are
double. Excel stores dates as numbers with a date format. Cell returns double. Check the cell's XF number-format to know it's a date (or use TFlxNumberFormat.FormatValue helpers).
- Memory.
XlsFile, FlexCelReport, and the export classes hold the full workbook in memory. They are fully managed — GC handles cleanup. However, the export classes (FlexCelPdfExport, FlexCelHtmlExport, FlexCelImgExport) and FlexCelReport implement IDisposable; wrap them in using. XlsFile does not require using, but don't hold big workbooks as long-lived statics.
- Use APIMate. For anything Excel-specific ("how do I add a data validation / a conditional format / a chart / a pivot table?"), the canonical answer is: build it in Excel → open the file in APIMate (ships with FlexCel, also available for Linux and macOS) → copy the generated C# or VB.NET code. Tell the user this.
- Native AOT (.NET 9+):
XlsFile and the exporters are fully supported. FlexCelReport uses reflection on your POCO types — annotate them with [DynamicallyAccessedMembers(...)] or reports fail silently after trimming. See references/pitfalls.md.
Quick-start recipes
All examples are C#. For VB.NET, translate syntactically — APIs are identical.
Recipe 1 — Create an Excel file
using System;
using System.IO;
using FlexCel.Core;
using FlexCel.XlsAdapter;
class Program
{
static void Main()
{
// Empty workbook: 1 sheet, Excel-2019 default formatting.
var xls = new XlsFile(1, TExcelFileFormat.v2019, true);
xls.SetCellValue(1, 1, "Hello from FlexCel!"); // A1 text
xls.SetCellValue(2, 1, 7); // A2 number (stored as double)
xls.SetCellValue(3, 1, 11.3); // A3 number
xls.SetCellValue(4, 1, new TFormula("=Sum(A2:A3)")); // A4 formula
xls.Save(Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.Personal),
"test.xlsx"));
}
}
Key points:
- Indices are 1-based:
(1, 1) = A1.
- File format is inferred from the extension (
.xlsx → OOXML, .xls → BIFF8). Override via xls.Save(stream, TFileFormats.Xlsx) when saving to streams.
SetCellValue(1, 1, "7") writes a string "7"; SetCellValue(1, 1, 7) writes a number 7. Type dispatch happens through method overloads.
Recipe 2 — Read an Excel file
using System;
using System.IO;
using FlexCel.Core;
using FlexCel.XlsAdapter;
void ReadExcel(string path)
{
var xls = new XlsFile(path);
xls.ActiveSheetByName = "Sheet1"; // or: xls.ActiveSheet = 1..xls.SheetCount
for (int row = 1; row <= xls.RowCount; row++)
{
// Use ColCountInRow, NOT ColCount — much faster. See performance guide.
for (int colIndex = 1; colIndex <= xls.ColCountInRow(row); colIndex++)
{
int XF = -1;
object cell = xls.GetCellValueIndexed(row, colIndex, ref XF);
var addr = new TCellAddress(row, xls.ColFromIndex(row, colIndex));
string kind =
cell == null ? "empty"
: cell is TRichString ? "rich string"
: cell is string ? "string"
: cell is double ? "number"
: cell is bool ? "bool"
: cell is TFlxFormulaErrorValue ? "error"
: cell is TFormula ? "formula"
: "unknown";
Console.WriteLine($"Cell {addr.CellRef} {kind}: {cell}");
}
}
}
Key points:
- Iterate with
ColCountInRow + GetCellValueIndexed + ColFromIndex. The three together skip empty cells and give you the real column number of each non-empty cell.
GetCellValueIndexed takes XF by ref and writes the cell's format index into it.
cell == null means the cell is empty (never allocated). A cell containing an empty string is a different thing.
Recipe 3 — Export Excel to PDF
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Render;
void XlsxToPdf(string src, string dst)
{
var xls = new XlsFile(src);
using var pdf = new FlexCelPdfExport(xls, true); // true = allow overwrite
pdf.Export(dst); // all visible sheets, honoring Excel page setup
}
For PDF/A, font subsetting, digital signatures, multi-workbook PDFs, or tuning fonts on Linux/Docker see references/pdf-html-export.md.
Recipe 4 — Run a report from a template
Assume an Excel template invoice-template.xlsx already exists, with tags like <#Customers.Name> inside a named range __Customers__ spanning the repeating row(s).
using System;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
void RunReport(DataTable customers)
{
using var report = new FlexCelReport(true); // true = allow overwrite
// Supply data sources
report.AddTable("Customers", customers); // DataTable / DataSet / IEnumerable<T>
// Scalar values
report.SetValue("ReportDate", DateTime.Now);
report.SetValue("CompanyName", "Acme Corp");
report.Run("invoice-template.xlsx", "invoice-output.xlsx");
}
AddTable overloads (the most common):
report.AddTable("Customers", customerList); // IEnumerable<T> / List<T> / IQueryable<T>
report.AddTable("Customers", customerDataTable); // DataTable
report.AddTable(customerDataSet); // DataSet — each contained DataTable by name
report.AddTable(myCustomerList); // single-arg: band name inferred from type name
To output directly to PDF — run the report into a fresh XlsFile, then pipe that through FlexCelPdfExport:
var outXls = new XlsFile();
report.Run("template.xlsx", outXls);
using var pdf = new FlexCelPdfExport(outXls, true);
pdf.Export("report.pdf");
For the full tag language and template-design conventions see references/reports-cheatsheet.md.
When to consult the references
Load a reference file only when the task actually needs it — keeps context lean for simple tasks.
references/api-cheatsheet.md — deeper XlsFile / ExcelFile usage: formatting, fonts, colors, merging, row/column sizing, comments, images, charts, data validation, protection, named ranges, InsertAndCopyRange / DeleteRange / MoveRange, sheet management, streams, recalc, virtual mode.
references/reports-cheatsheet.md — full tag reference, named-range conventions for bands, master-detail, config sheets, user functions, events.
references/pdf-html-export.md — FlexCelPdfExport, FlexCelHtmlExport, FlexCelImgExport options: PDF/A, font embedding, digital signing, HTML5, image embedding, multi-workbook PDFs.
references/pitfalls.md — extended gotchas, Native AOT specifics, Docker/Linux fonts, locale, barcodes, conditional formats, strict xlsx.
When you need authoritative detail
The cheatsheets cover the common path. For anything deeper, fetch from the public documentation source:
- Markdown source (raw):
https://raw.githubusercontent.com/tmssoftware/TMS-FlexCel.NET-doc-src/main/<path>.md
- Guides:
guides/api-developer-guide.md, guides/reports-developer-guide.md, guides/reports-tag-reference.md, guides/pdf-exporting-guide.md, guides/html-exporting-guide.md, guides/performance-guide.md, guides/multiplatform-guide.md
- Tips:
tips/<topic>.md (one file per tip — includes native-aot.md)
- API reference:
api/FlexCel.XlsAdapter/XlsFile/<MemberName>.md, api/FlexCel.Report/FlexCelReport/<MemberName>.md, etc.
- Rendered docs:
https://doc.tmssoftware.com/flexcel/net/index.html
- Official sample repository (C# + VB.NET, desktop + mobile):
https://github.com/tmssoftware/TMS-FlexCel.NET-demos
Use WebFetch on the raw markdown URL when you need to confirm a signature or pull an official example. Prefer the raw markdown over the rendered HTML.
Style expectations for generated code
- Use
using declarations / blocks for FlexCelReport, FlexCelPdfExport, FlexCelHtmlExport, FlexCelImgExport. They're IDisposable.
XlsFile does not implement IDisposable; don't wrap it in using. Let it go out of scope and GC will collect it.
- Use 1-based literals explicitly (
SetCellValue(1, 1, ...)) — never pretend indices are 0-based.
- Use
is pattern matching (or switch expressions on type) for GetCellValue results — don't cast blindly.
- When providing PDF font folders, fall back gracefully: on Linux/macOS/Docker the fonts used by the workbook may not exist on the target. Use
FlexCelPdfExport.GetFontFolder or GetFontData events.
- For Native AOT: always annotate POCOs passed to
FlexCelReport.AddTable with [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicMethods)]. Without it, trimming will silently strip property accessors.
- Don't invent method names. If unsure, check the API markdown under
api/<namespace>/<class>/<member>.md in the doc source, or tell the user to verify with APIMate.
1---2name: flexcel-net3description: Use when writing C# / VB.NET / F# code that reads, writes, manipulates, or exports Excel (.xlsx / .xls) files, generates PDF or HTML from Excel, or produces data-driven reports with FlexCel Studio for .NET (TMS Software). Triggers include Excel/xlsx from C#, XlsFile, FlexCelReport, FlexCelPdfExport, FlexCelHtmlExport, FlexCelImgExport, ExcelFile, PdfWriter, .NET Excel export, ASP.NET Excel generation, .NET MAUI Excel, Native AOT + Excel, and Excel reporting from .NET.4---5
6# FlexCel Studio for .NET
7
8This skill helps write **C# / VB.NET / F#** code that uses **FlexCel** — the TMS Software library for working with Excel `.xlsx` / `.xls` files, exporting to PDF / HTML / SVG / images, and generating data-driven reports from templates. Works with .NET Framework 4.6+, .NET Core / .NET 5+, .NET Standard 2.0+, .NET MAUI, Xamarin, and .NET 9 Native AOT (with caveats — see below).
9
10## When to use this skill
11
12Activate whenever the user wants to, from .NET code:
13
14- **Read** an Excel file (`.xlsx` or `.xls`) — cell values, formulas, formatting.
15- **Create or modify** an Excel file programmatically.
16- **Generate reports** by merging data into Excel templates.
17- **Export** an Excel file to **PDF**, **HTML**, **SVG**, or images.
18- **Autofit** rows/columns, render sheets, or measure cells.
19- Target **.NET Framework, .NET Core / .NET 5+, .NET MAUI, Xamarin, Blazor server, ASP.NET Core**, or **Native AOT**.
20
21FlexCel does **not** require Excel or any Office installation on the target machine. No OLE/COM, no interop. Fully managed — works on Windows, Linux, macOS, iOS, and Android.
22
23## Two ways to create Excel files — pick one
24
25Before writing code, decide which API fits the task:
26
27| If the user wants to… | Use | Why |
28|-----------------------|-----|-----|
29| Read existing files, or build files cell-by-cell in code | **`XlsFile` API** (`FlexCel.XlsAdapter`) | Full programmatic control; no designer required; Native-AOT-safe. |
30| Produce the same report repeatedly from changing data, with a styled layout | **`FlexCelReport` + Excel template** (`FlexCel.Report`) | Non-programmers can edit the template in Excel; code only provides data. |
31
32When the user says "generate a report with company logo / nice formatting / many rows from a database", prefer **Reports**. When they say "read this file and extract values" or "create an Excel file with these calculations", prefer the **API**.
33
34You can combine both: run a report to produce an in-memory `XlsFile`, then manipulate it with the API, then export to PDF.
35
36## Package and namespace reference
37
38**NuGet package:** `TMS.FlexCel` (includes almost all functionality). Install via `dotnet add package TMS.FlexCel` **after configuring the TMS NuGet source** — FlexCel is hosted at TMS's own NuGet feed, not on nuget.org. See `guides/installation-guide.md` in the doc source for feed setup.
39
40Optional companion packages:
41- `TMS.FlexCel.WinForms` — WinForms preview / grid components.
42- `TMS.FlexCel.WebForms` — legacy WebForms viewer (rarely needed).
43
44**Namespaces — add per task:**
45
46| Task | `using` |
47|------|---------|
48| Any FlexCel code | `using FlexCel.Core;` |
49| Read / write xls/xlsx | `using FlexCel.XlsAdapter;` |
50| PDF / HTML / image export, autofitting | `using FlexCel.Render;` |
51| Low-level PDF access (sign, PDF/A, standalone PDF) | `using FlexCel.Pdf;` |
52| Template-based reports | `using FlexCel.Report;` |
53| WinForms components | `using FlexCel.Winforms;` |
54| ASP.NET helpers | `using FlexCel.AspNet;` |
55
56**Note:** Unlike the VCL edition, `.NET` has **no platform-support unit/assembly** to register in the entry point — all platform integration ships with the core package. Just reference `TMS.FlexCel` and you're done.
57
58## Critical gotchas (read this every time)
59
601. **1-based indexing** for rows, columns, and sheets. `xls.SetCellValue(1, 1, ...)` writes to `A1`. XF (format) indices are the single exception — they are **0-based**.
612. **No `T` prefix on class names.** VCL has `TXlsFile`, `TFlexCelReport`, `TFlexCelPdfExport`. .NET has **`XlsFile`**, **`FlexCelReport`**, **`FlexCelPdfExport`**. However value-type structs keep the `T` — `TFormula`, `TFlxFormat`, `TCellAddress`, `TRichString`, `TExcelFileFormat`, `TFlxFormulaErrorValue`.
623. **`GetCellValue` returns `object`.** There is no `TCellValue` discriminated union in .NET. Dispatch with `is` pattern matching:
63 ```csharp
64 if (cell == null) { /* empty */ }
65 else if (cell is string s) { /* plain text */ }
66 else if (cell is TRichString rs) { /* rich text */ }
67 else if (cell is double d) { /* number (dates too!) */ }
68 else if (cell is bool b) { /* boolean */ }
69 else if (cell is TFlxFormulaErrorValue) { /* #DIV/0 etc. */ }
70 else if (cell is TFormula f) { /* formula */ }
71 ```
724. **Never iterate with `ColCount`** — it scans the whole sheet. Use `ColCountInRow(row)` + `GetCellValueIndexed(row, colIdx, ref XF)` + `ColFromIndex(row, colIdx)` — this is sparse-aware and dramatically faster on real files.
735. **Dates are `double`.** Excel stores dates as numbers with a date format. Cell returns `double`. Check the cell's XF number-format to know it's a date (or use `TFlxNumberFormat.FormatValue` helpers).
746. **Memory.** `XlsFile`, `FlexCelReport`, and the export classes hold the full workbook in memory. They are fully managed — GC handles cleanup. However, the export classes (`FlexCelPdfExport`, `FlexCelHtmlExport`, `FlexCelImgExport`) and `FlexCelReport` **implement `IDisposable`**; wrap them in `using`. `XlsFile` does **not** require `using`, but don't hold big workbooks as long-lived statics.
757. **Use APIMate.** For anything Excel-specific ("how do I add a data validation / a conditional format / a chart / a pivot table?"), the canonical answer is: build it in Excel → open the file in **APIMate** (ships with FlexCel, also available for Linux and macOS) → copy the generated C# or VB.NET code. Tell the user this.
768. **Native AOT** (.NET 9+): `XlsFile` and the exporters are fully supported. `FlexCelReport` uses reflection on your POCO types — annotate them with `[DynamicallyAccessedMembers(...)]` or reports fail silently after trimming. See `references/pitfalls.md`.
77
78## Quick-start recipes
79
80All examples are C#. For VB.NET, translate syntactically — APIs are identical.
81
82### Recipe 1 — Create an Excel file
83
84```csharp
85using System;
86using System.IO;
87using FlexCel.Core;
88using FlexCel.XlsAdapter;
89
90class Program
91{
92 static void Main()
93 {
94 // Empty workbook: 1 sheet, Excel-2019 default formatting.
95 var xls = new XlsFile(1, TExcelFileFormat.v2019, true);
96
97 xls.SetCellValue(1, 1, "Hello from FlexCel!"); // A1 text
98 xls.SetCellValue(2, 1, 7); // A2 number (stored as double)
99 xls.SetCellValue(3, 1, 11.3); // A3 number
100 xls.SetCellValue(4, 1, new TFormula("=Sum(A2:A3)")); // A4 formula
101
102 xls.Save(Path.Combine(
103 Environment.GetFolderPath(Environment.SpecialFolder.Personal),
104 "test.xlsx"));
105 }
106}
107```
108
109Key points:
110- Indices are **1-based**: `(1, 1)` = `A1`.
111- File format is inferred from the extension (`.xlsx` → OOXML, `.xls` → BIFF8). Override via `xls.Save(stream, TFileFormats.Xlsx)` when saving to streams.
112- `SetCellValue(1, 1, "7")` writes a **string** `"7"`; `SetCellValue(1, 1, 7)` writes a **number** `7`. Type dispatch happens through method overloads.
113
114### Recipe 2 — Read an Excel file
115
116```csharp
117using System;
118using System.IO;
119using FlexCel.Core;
120using FlexCel.XlsAdapter;
121
122void ReadExcel(string path)
123{
124 var xls = new XlsFile(path);
125 xls.ActiveSheetByName = "Sheet1"; // or: xls.ActiveSheet = 1..xls.SheetCount
126
127 for (int row = 1; row <= xls.RowCount; row++)
128 {
129 // Use ColCountInRow, NOT ColCount — much faster. See performance guide.
130 for (int colIndex = 1; colIndex <= xls.ColCountInRow(row); colIndex++)
131 {
132 int XF = -1;
133 object cell = xls.GetCellValueIndexed(row, colIndex, ref XF);
134 var addr = new TCellAddress(row, xls.ColFromIndex(row, colIndex));
135
136 string kind =
137 cell == null ? "empty"
138 : cell is TRichString ? "rich string"
139 : cell is string ? "string"
140 : cell is double ? "number"
141 : cell is bool ? "bool"
142 : cell is TFlxFormulaErrorValue ? "error"
143 : cell is TFormula ? "formula"
144 : "unknown";
145
146 Console.WriteLine($"Cell {addr.CellRef} {kind}: {cell}");
147 }
148 }
149}
150```
151
152Key points:
153- **Iterate with `ColCountInRow` + `GetCellValueIndexed` + `ColFromIndex`**. The three together skip empty cells and give you the real column number of each non-empty cell.
154- `GetCellValueIndexed` takes XF **by `ref`** and writes the cell's format index into it.
155- `cell == null` means the cell is empty (never allocated). A cell containing an empty string is a different thing.
156
157### Recipe 3 — Export Excel to PDF
158
159```csharp
160using FlexCel.Core;
161using FlexCel.XlsAdapter;
162using FlexCel.Render;
163
164void XlsxToPdf(string src, string dst)
165{
166 var xls = new XlsFile(src);
167 using var pdf = new FlexCelPdfExport(xls, true); // true = allow overwrite
168 pdf.Export(dst); // all visible sheets, honoring Excel page setup
169}
170```
171
172For PDF/A, font subsetting, digital signatures, multi-workbook PDFs, or tuning fonts on Linux/Docker see `references/pdf-html-export.md`.
173
174### Recipe 4 — Run a report from a template
175
176Assume an Excel template `invoice-template.xlsx` already exists, with tags like `<#Customers.Name>` inside a named range `__Customers__` spanning the repeating row(s).
177
178```csharp
179using System;
180using System.Data;
181using FlexCel.Core;
182using FlexCel.XlsAdapter;
183using FlexCel.Report;
184
185void RunReport(DataTable customers)
186{
187 using var report = new FlexCelReport(true); // true = allow overwrite
188
189 // Supply data sources
190 report.AddTable("Customers", customers); // DataTable / DataSet / IEnumerable<T>
191
192 // Scalar values
193 report.SetValue("ReportDate", DateTime.Now);
194 report.SetValue("CompanyName", "Acme Corp");
195
196 report.Run("invoice-template.xlsx", "invoice-output.xlsx");
197}
198```
199
200**AddTable overloads** (the most common):
201
202```csharp
203report.AddTable("Customers", customerList); // IEnumerable<T> / List<T> / IQueryable<T>
204report.AddTable("Customers", customerDataTable); // DataTable
205report.AddTable(customerDataSet); // DataSet — each contained DataTable by name
206report.AddTable(myCustomerList); // single-arg: band name inferred from type name
207```
208
209**To output directly to PDF** — run the report into a fresh `XlsFile`, then pipe that through `FlexCelPdfExport`:
210
211```csharp
212var outXls = new XlsFile();
213report.Run("template.xlsx", outXls);
214using var pdf = new FlexCelPdfExport(outXls, true);
215pdf.Export("report.pdf");
216```
217
218For the full tag language and template-design conventions see `references/reports-cheatsheet.md`.
219
220## When to consult the references
221
222Load a reference file only when the task actually needs it — keeps context lean for simple tasks.
223
224- **`references/api-cheatsheet.md`** — deeper `XlsFile` / `ExcelFile` usage: formatting, fonts, colors, merging, row/column sizing, comments, images, charts, data validation, protection, named ranges, `InsertAndCopyRange` / `DeleteRange` / `MoveRange`, sheet management, streams, recalc, virtual mode.
225- **`references/reports-cheatsheet.md`** — full tag reference, named-range conventions for bands, master-detail, config sheets, user functions, events.
226- **`references/pdf-html-export.md`** — `FlexCelPdfExport`, `FlexCelHtmlExport`, `FlexCelImgExport` options: PDF/A, font embedding, digital signing, HTML5, image embedding, multi-workbook PDFs.
227- **`references/pitfalls.md`** — extended gotchas, Native AOT specifics, Docker/Linux fonts, locale, barcodes, conditional formats, strict xlsx.
228
229## When you need authoritative detail
230
231The cheatsheets cover the common path. For anything deeper, fetch from the public documentation source:
232
233- **Markdown source (raw):** `https://raw.githubusercontent.com/tmssoftware/TMS-FlexCel.NET-doc-src/main/<path>.md`
234 - Guides: `guides/api-developer-guide.md`, `guides/reports-developer-guide.md`, `guides/reports-tag-reference.md`, `guides/pdf-exporting-guide.md`, `guides/html-exporting-guide.md`, `guides/performance-guide.md`, `guides/multiplatform-guide.md`
235 - Tips: `tips/<topic>.md` (one file per tip — includes `native-aot.md`)
236 - API reference: `api/FlexCel.XlsAdapter/XlsFile/<MemberName>.md`, `api/FlexCel.Report/FlexCelReport/<MemberName>.md`, etc.
237- **Rendered docs:** `https://doc.tmssoftware.com/flexcel/net/index.html`
238- **Official sample repository (C# + VB.NET, desktop + mobile):** `https://github.com/tmssoftware/TMS-FlexCel.NET-demos`
239
240Use `WebFetch` on the raw markdown URL when you need to confirm a signature or pull an official example. Prefer the raw markdown over the rendered HTML.
241
242## Style expectations for generated code
243
244- Use `using` declarations / blocks for `FlexCelReport`, `FlexCelPdfExport`, `FlexCelHtmlExport`, `FlexCelImgExport`. They're `IDisposable`.
245- `XlsFile` does **not** implement `IDisposable`; don't wrap it in `using`. Let it go out of scope and GC will collect it.
246- Use 1-based literals explicitly (`SetCellValue(1, 1, ...)`) — never pretend indices are 0-based.
247- Use `is` pattern matching (or switch expressions on type) for `GetCellValue` results — don't cast blindly.
248- When providing PDF font folders, fall back gracefully: on Linux/macOS/Docker the fonts used by the workbook may not exist on the target. Use `FlexCelPdfExport.GetFontFolder` or `GetFontData` events.
249- For **Native AOT**: always annotate POCOs passed to `FlexCelReport.AddTable` with `[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicMethods)]`. Without it, trimming will silently strip property accessors.
250- Don't invent method names. If unsure, check the API markdown under `api/<namespace>/<class>/<member>.md` in the doc source, or tell the user to verify with APIMate.