--- name: devexpress-reports-aspnetcore description: > Integrate DevExpress Report Viewer and Report Designer into ASP.NET Core MVC and Razor Pages. Configure Program.cs with AddDevExpressControls, ConfigureReportingServices. Register client assets via package.json + libman.json + direct script/link tags (existing apps) or BuildBundlerMinifier + bundleconfig.json (bundled/demo projects). Implement ReportStorageWebExtension, IReportProvider. Customize viewer toolbar, tab panel, export options, parameter editors. Security: authorization, CSRF, Content Security Policy. Report caching with UseCachedReportSourceBuilder. Deploy to Linux/macOS with Skia. Troubleshoot blank viewer, 400/404/500 errors, "Unable to process binding", "Report not found", CORS, version mismatches. Use when: add document viewer, end-user report designer, ASP.NET Core reporting, web farm document storage, upgrade DevExpress reporting packages. compatibility: Requires .NET 8.0+. DevExpress NuGet packages are published on NuGet.org. Node.js (LTS) required regardless of client-resource pattern (LibMan reads from node_modules/ either way). DevExpress.Drawing.Skia required for Linux/macOS hosting. All DevExpress packages must share the same version. metadata: author: DevExpress version: "26.1" source-commit: 4ffd3390ef53dde5c173f83c51a71d523d0c6eb1 --- # DevExpress ASP.NET Core Reporting — Viewer & Designer Integration 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. ## When to Use This Skill - Add a Document Viewer to an ASP.NET Core application - Add an End-User Report Designer to an ASP.NET Core application - Configure Program.cs services and middleware for reporting - Register reporting client assets — via direct ` @(Html.DevExpress().WebDocumentViewer("DocumentViewer") .Height("100%") .ClientSideEvents(ev => ev .CustomizeMenuActions("onCustomizeMenuActions") .BeforeRender("onBeforeRender")) .Bind(Model)) ``` The handler block goes in the same place for the Report Designer and the Parameters Panel — only the builder and the event names change. Adding the handler block at the top is the only structural change this track makes (Constraint 2). **2. Read the reference** for the requested feature — [viewer-customization.md](references/viewer-customization.md), [designer-customization.md](references/designer-customization.md), [standalone-parameters-panel.md](references/standalone-parameters-panel.md), [data-sources.md](references/data-sources.md), or [theming.md](references/theming.md) — and copy handler **bodies** and config values from it rather than from memory. A `bundleconfig.json`/`libman.json` edit is outside this track: take the templates from [client-resource-integration.md](references/client-resource-integration.md), and ask before editing an existing bundle. **3. Build and verify.** `dotnet build`, then run **Phase 4 — Validate** below - must-have verification. Pass `-KeepAlive` on the first run — you wired a client-side handler, so step 4's browser check is already required. --- ## Phase 4 — Validate (every task ends here) Run after Phase 3 or the Customization Track, and after any later change to bundles, `Program.cs`, `appsettings.json`, or views. > **The no-substitute rule.** `scripts/Verify-ReportingPage.ps1` (step 3) and the browser console (step 4) are the only evidence this skill accepts that a page works. **Nothing you write yourself counts** — not a checkmark list, not `-match 'id="DocumentViewer"'` against the response HTML, not "the bundle file exists on disk", not a grep that finds a library name inside another bundle. If the script did not run, could not be found, or you replaced it with a check of your own, the outcome is `NOT VERIFIED` and you say so. **"The build succeeds; I have not verified the page renders" is an accurate and acceptable completion — substituting your own check is not.** 1. `npm install` — must complete before `dotnet build` when `libman.json` uses the filesystem provider. Skip when you did not touch `libman.json` or `package.json`. 2. `dotnet build ` — the path is **positional**; `--project` is a `dotnet run` flag and fails with `MSB1001`. A clean build is required. When editor/IDE diagnostics disagree with the compiler, **the compiler wins**. A clean build does not confirm JS runtime health. **The served page is the ground truth** — validate against it, not against the build output. 3. **Launch and verify — one command, once per affected route. Never start the app yourself.** Run the script below for the new page and for every existing page whose bundles, layout, or `Program.cs` registrations you touched. The script starts the app, proves the launch succeeded, verifies the page, and stops only what it started. Pass the project **directory**, not the `.csproj` file itself: ```powershell & '/scripts/Verify-ReportingPage.ps1' -ProjectDir '' -Route '/Reports/Viewer' # add -Component Designer for a Designer page · allow the call ≥180s · exit codes: see the table below ``` `` is **this skill's base directory** (announced when the skill loaded). If the script cannot be found, the only permitted outcome is `NOT VERIFIED` — no-substitute rule. The script auto-detects the component (`-Component Viewer|Designer|ParametersPanel` asserts a specific one) and checks resource statuses, required-library presence, load order, duplicate loads, stylesheet-internal asset references (icon fonts), the init script, and leaked literal Razor text — under Patterns A, B, and C alike, including defects inside a concatenated bundle. > **This step runs the app.** `dotnet run` executes the project's startup path — migrations, seeding, hosted services — against whatever environment it resolves; the loopback-only, self-cleaning launch does not neutralize that. If Phase 1 recorded migrations/seeding or a non-local connection string, say so and confirm the environment first. A declined launch is `NOT VERIFIED` — never substitute a check of your own. 4. **Browser console check.** When adding `-KeepAlive` to the command above, the script leaves the server running and prints its URL and PID. Use **any MCP that can open a URL and read the browser console** — Chrome DevTools MCP, Playwright MCP, BrowserTools MCP, or similar — and confirm: (a) **Console** shows 0 JS errors (no `ReferenceError: is not defined`, no `DevExpress is not defined`, no `ko is not defined`, no `Unable to process binding`); (b) **Network** shows HTTP 200 for every DevExpress JS/CSS **and icon font** the page pulls (ignore `favicon.ico` issues) (c) integrated components render without a blank or error state (d) `typeof window.` is `'object'` for the instance name the script printed (e) Designer only — run the read-only storage probe **verbatim** from [references/report-storage.md](references/report-storage.md#verifying-storage-from-the-browser-console) (a Designer with no storage renders, logs no console error, and passes every check above). **Stop the printed PID when done.** If no such tool is available, stop the PID and report the runtime layer as unverified. 5. **Orphan sweep** — only if you revised `bundleconfig.json`, `libman.json`, or a view's asset tags mid-task. Renaming a bundle output leaves the previous file in `wwwroot`, unreferenced and undetected: `Verify-ReportingPage.ps1` only inspects resources the page actually references. List every `*.bundle.js`/`*.bundle.css` in `wwwroot` and delete any no longer in the current config's `outputFileName` set — an orphaned bundle commonly holds a duplicate, conflicting copy of jQuery or Bootstrap. **Reporting completion.** On success the script prints a one-line `VERIFIED:` stamp. Quote that line in your reply, and leave everything it lists as NOT verified unclaimed. | Exit | Verdict | What your reply must do | |---|---|---| | 0 | PASS | Quote the stamp. Whatever it lists as NOT verified stays unclaimed. | | 1 | FAIL | **`Read` [references/troubleshooting.md](references/troubleshooting.md) in full, then fix it.** A FAIL is never disproved by a check of your own — no-substitute rule. If the defect pre-dates your change, say so **and name it** — never omit a FAIL from the reply. | | 2 | INCONCLUSIVE | If it says the route **did not render** (redirect or 401/403), the page was never fetched — change nothing, and either re-run against the route that serves it or report `NOT VERIFIED`. Otherwise re-run once with `-StartupTimeoutSec 180`, then report `NOT VERIFIED`. | ## Documentation & Navigation Guide ### Full Setup — MVC and Razor Pages (Program.cs, controllers, views; Direct References client-resource pattern) 📄 [references/getting-started.md](references/getting-started.md) 📄 [references/getting-started-razor-pages.md](references/getting-started-razor-pages.md) Step-by-step NuGet/npm/libman/Program.cs/controller/view code for a fresh Viewer or Designer integration — MVC in the first file, Razor Pages in the second. Pattern A (Direct References) inline, including the full `libman.json` and `