$npx -y skills add DevExpress/agent-skills --skill devexpress-reports-coreCreate reports programmatically with DevExpress XtraReports runtime API (.NET and .NET Framework). Build XtraReport in code, add bands (DetailBand, GroupHeaderBand), controls (XRLabel, XRTable, XRChart), parameters, expressions. Bind to data sources, calculated fields, group repo
| 1 | # DevExpress XtraReports — Core Runtime API |
| 2 | |
| 3 | ## When to Use This Skill |
| 4 | |
| 5 | > **CRITICAL — Do not bypass this skill.** Whenever this skill is active, follow the patterns and constraints here. Do not substitute your own general knowledge of DevExpress APIs. If a scenario is not covered in the main skill body, read the relevant reference file or use MCP servers before writing code — do not guess API signatures. |
| 6 | |
| 7 | Use for any task involving: |
| 8 | - Creating `XtraReport` instances and building report structure in code |
| 9 | - Adding bands (DetailBand, GroupHeaderBand, ReportHeaderBand, etc.) |
| 10 | - Adding controls (XRLabel, XRTable, XRChart, XRPictureBox, etc.) to bands |
| 11 | - Binding reports to data sources (IList, DataTable, SqlDataSource, ObjectDataSource) |
| 12 | - Defining report parameters, calculated fields, and expression bindings |
| 13 | - Exporting reports: `ExportToPdf`, `ExportToXlsx`, `ExportToDocx`, `ExportToCsv`, etc. |
| 14 | - Configuring `PdfExportOptions`, `XlsxExportOptions`, etc. |
| 15 | - Saving/loading report layouts with `SaveLayoutToXml` / `LoadLayoutFromXml` |
| 16 | - Report types: table, master-detail, cross-tab, label, subreport |
| 17 | |
| 18 | > **Scope**: This skill covers runtime API only — no viewer UI, no print preview, no designer embedding. For platform-specific viewer integration, see: `devexpress-reports-aspnetcore`, `devexpress-reports-blazor`, `devexpress-reports-winforms`, or `devexpress-reports-wpf`. |
| 19 | |
| 20 | ## Before You Start |
| 21 | |
| 22 | If the host agent has a structured question-asking tool available, use it to ask these questions one at a time with clear options — for example, Claude Code's `AskUserQuestion` tool or GitHub Copilot's `askQuestions` tool. If no such tool is available, ask the questions directly in the chat response before generating code. |
| 23 | |
| 24 | Ask the developer: |
| 25 | |
| 26 | 1. **Target framework**: .NET 8+ or .NET Framework 4.x? |
| 27 | 2. **Platform**: WinForms, WPF, ASP.NET Core, Blazor, console/service, or MAUI? |
| 28 | 3. **Operation**: Create a new report in code? Load existing `.repx` layout? Modify an existing report class? |
| 29 | 4. **Data source**: What data are you binding? (IList/collection, DataTable/DataSet, EF DbContext, SQL database, JSON, Excel, none) |
| 30 | 5. **Output**: Export to file/stream? Which format(s)? Or display in a viewer? |
| 31 | 6. **Existing NuGet setup**: Are DevExpress packages already installed, or starting fresh? |
| 32 | |
| 33 | ## Prerequisites & Installation |
| 34 | |
| 35 | Add the platform NuGet package from `nuget.org`: |
| 36 | |
| 37 | | Platform | NuGet Package | |
| 38 | |----------|---------------| |
| 39 | | WinForms | `DevExpress.Win.Reporting` | |
| 40 | | WPF | `DevExpress.Wpf.Reporting` | |
| 41 | | ASP.NET Core | `DevExpress.AspNetCore.Reporting` | |
| 42 | | ASP.NET Web Forms and MVC | `DevExpress.Web.Reporting` | |
| 43 | | Console / server | `DevExpress.Reporting.Core` (core only) | |
| 44 | |
| 45 | All packages include the required namespaces (`DevExpress.XtraReports.UI`, `DevExpress.XtraPrinting`, `DevExpress.Drawing`) and export infrastructure. |
| 46 | |
| 47 | > **Linux/macOS** (non-Windows): Add `DevExpress.Drawing.Skia` for PDF rendering support. |
| 48 | |
| 49 | ## Core Classes Overview |
| 50 | |
| 51 | | Class | Namespace | Role | |
| 52 | |-------|-----------|------| |
| 53 | | `XtraReport` | `DevExpress.XtraReports.UI` | Root report object | |
| 54 | | `DetailBand` | `DevExpress.XtraReports.UI` | Repeating data rows (mandatory) | |
| 55 | | `ReportHeaderBand` | `DevExpress.XtraReports.UI` | Once at report start | |
| 56 | | `ReportFooterBand` | `DevExpress.XtraReports.UI` | Once at report end | |
| 57 | | `GroupHeaderBand` | `DevExpress.XtraReports.UI` | Group header | |
| 58 | | `GroupFooterBand` | `DevExpress.XtraReports.UI` | Group summary | |
| 59 | | `PageHeaderBand` | `DevExpress.XtraReports.UI` | Every page top | |
| 60 | | `PageFooterBand` | `DevExpress.XtraReports.UI` | Every page bottom | |
| 61 | | `DetailReportBand` | `DevExpress.XtraReports.UI` | Nested (master-detail) data | |
| 62 | | `XRLabel` | `DevExpress.XtraReports.UI` | Text / field display | |
| 63 | | `XRTable` / `XRTableRow` / `XRTableCell` | `DevExpress.XtraReports.UI` | Tabular layout | |
| 64 | | `XRPictureBox` | `DevExpress.XtraReports.UI` | Images | |
| 65 | | `XRChart` | `DevExpress.XtraReports.UI` | Charts | |
| 66 | | `XRCrossTab` |