$npx -y skills add DevExpress/agent-skills --skill devexpress-reports-aspnetcoreIntegrate DevExpress Report Viewer and Report Designer into ASP.NET Core MVC and Razor Pages. Configure Program.cs with AddDevExpressControls, ConfigureReportingServices. Set up npm bundling (bundleconfig.json, libman.json). Implement ReportStorageWebExtension, IReportProvider. C
| 1 | # DevExpress ASP.NET Core Reporting — Viewer & Designer Integration |
| 2 | |
| 3 | Integrates the DevExpress Web Document Viewer (read-only preview) and Web Report Designer (full end-user designer) into ASP.NET Core MVC and Razor Pages applications. The viewer renders reports in the browser via server-side document generation; the designer lets end-users create and save reports without developer involvement. |
| 4 | |
| 5 | This skill covers **UI component integration only**. For creating reports programmatically (bands, controls, data binding, expressions, export), use the `devexpress-reports-core` skill. |
| 6 | |
| 7 | ## When to Use This Skill |
| 8 | |
| 9 | - Add a Document Viewer to an ASP.NET Core MVC or Razor Pages application |
| 10 | - Add an End-User Report Designer to an ASP.NET Core application |
| 11 | - Configure Program.cs services and middleware for reporting |
| 12 | - Set up npm bundling (bundleconfig.json, libman.json) for reporting assets |
| 13 | - Implement `ReportStorageWebExtension` or `IReportProvider` |
| 14 | - Customize viewer/designer toolbar, tab panel, export options, parameter editors |
| 15 | - Configure security: authorization, CSRF protection, CSP nonce |
| 16 | - Deploy reporting to Linux or macOS (Skia renderer setup) |
| 17 | - Troubleshoot blank viewers, HTTP errors, or script loading failures |
| 18 | - Set up multi-server (web farm/garden) document storage |
| 19 | |
| 20 | ## Prerequisites & Installation |
| 21 | |
| 22 | ### NuGet Packages |
| 23 | |
| 24 | | Package | Purpose | |
| 25 | |---------|---------| |
| 26 | | `DevExpress.AspNetCore.Reporting` | Document Viewer + Report Designer server-side | |
| 27 | | `BuildBundlerMinifier` | Bundles npm output into wwwroot/ | |
| 28 | | `Microsoft.Web.LibraryManager.Build` | Copies icon fonts to wwwroot/ | |
| 29 | | `DevExpress.Drawing.Skia` | **Required** on Linux and macOS hosts | |
| 30 | |
| 31 | ### npm Packages (package.json) |
| 32 | |
| 33 | ```json |
| 34 | { |
| 35 | "dependencies": { |
| 36 | "bootstrap": "^4.3.1", |
| 37 | "devextreme-dist": "26.1-stable", |
| 38 | "@devexpress/analytics-core": "26.1-stable", |
| 39 | "devexpress-reporting": "26.1-stable" |
| 40 | } |
| 41 | } |
| 42 | ``` |
| 43 | |
| 44 | > **npm and NuGet versions must match.** All DevExpress packages — both npm and NuGet — must use the same major.minor version (e.g., `26.1`). A mismatch causes `configurator.UseDevelopmentMode()` to report version errors and the viewer to silently fail. |
| 45 | |
| 46 | ### Mandatory Setup Order |
| 47 | |
| 48 | Complete all steps in order before running the app. Missing any step causes the viewer/designer to fail silently or throw 500 errors. |
| 49 | |
| 50 | **Step 1 — Install NuGet packages** (`DevExpress.AspNetCore.Reporting`, `BuildBundlerMinifier`, `Microsoft.Web.LibraryManager.Build`) |
| 51 | |
| 52 | **Step 2 — Install Node.js** (LTS) if not already installed |
| 53 | |
| 54 | **Step 3 — Add package.json** with npm dependencies above; right-click → Restore Packages or run `npm install`. npm install **must complete before** `dotnet build` — LibMan's filesystem provider requires `node_modules` to exist. |
| 55 | |
| 56 | **Step 4 — Add bundleconfig.json** (see [references/getting-started.md](references/getting-started.md) for full content). This defines CSS/JS bundles that are copied to `wwwroot/` at build time. |
| 57 | |
| 58 | **Step 5 — Add libman.json** (see [references/getting-started.md](references/getting-started.md)) to copy icon font files to `wwwroot/css/icons/`. |
| 59 | |
| 60 | **Step 6 — Program.cs** — add three lines: |
| 61 | ```csharp |
| 62 | using DevExpress.AspNetCore; |
| 63 | using DevExpress.AspNetCore.Reporting; // required for ConfigureReportingServices |
| 64 | |
| 65 | builder.Services.AddDevExpressControls(); |
| 66 | builder.Services.ConfigureReportingServices(configurator => { |
| 67 | configurator.ConfigureWebDocumentViewer(c => c.UseCachedReportSourceBuilder()); |
| 68 | }); |
| 69 | // ... (after builder.Build()) |
| 70 | app.UseDevExpressControls(); // must come BEFORE app.UseStaticFiles() |
| 71 | app.UseStaticFiles(); |
| 72 | ``` |
| 73 | |
| 74 | **Step 7 — Add controllers** (see Component Overview below) |
| 75 | |
| 76 | **Step 8 — _ViewImports.cshtml**: |
| 77 | ```cshtml |
| 78 | @using DevExpress.AspNetCore |
| 79 | ``` |
| 80 | |
| 81 | **Step 9 — _Layout.cshtml** — add thirdparty bundle to `<head>`: |
| 82 | ```cshtml |
| 83 | <link rel="stylesheet" href="~/css/thirdp |