DocWright.Reporting.Viewer
1.1.4
dotnet add package DocWright.Reporting.Viewer --version 1.1.4
NuGet\Install-Package DocWright.Reporting.Viewer -Version 1.1.4
<PackageReference Include="DocWright.Reporting.Viewer" Version="1.1.4" />
<PackageVersion Include="DocWright.Reporting.Viewer" Version="1.1.4" />
<PackageReference Include="DocWright.Reporting.Viewer" />
paket add DocWright.Reporting.Viewer --version 1.1.4
#r "nuget: DocWright.Reporting.Viewer, 1.1.4"
#:package DocWright.Reporting.Viewer@1.1.4
#addin nuget:?package=DocWright.Reporting.Viewer&version=1.1.4
#tool nuget:?package=DocWright.Reporting.Viewer&version=1.1.4
DocWright.Reporting.Viewer
The viewer surface for DocWright reports: an HTML + inline-SVG projection of a paginated report, a JSON region map a viewer binds to, and the services a viewer needs over that model — hit-testing, action resolution, full-text search, toggling with incremental re-pagination, and a design-time preview.
It reads the same ReportPageModel that produces the PDF and the page images, so a preview and an export
cannot paginate differently.
Install
dotnet add package DocWright.Reporting.Viewer
You will also want DocWright.Reporting (the model,
the expression engine, processing and pagination) and
DocWright.Reporting.Rdl to read .rdl files.
Projecting a report
using DocWright.Fonts;
using DocWright.Reporting.Pagination;
using DocWright.Reporting.Viewer;
ReportPageModel pages = ReportPaginator.Paginate(instance, new FontEngine());
ReportHtmlProjection projection = ReportHtmlRenderer.Project(pages, new ReportHtmlOptions
{
Output = ReportHtmlOutput.Document,
});
File.WriteAllText("report.html", projection.Html);
File.WriteAllText("report-regions.json", projection.RegionMap.ToJson());
An item's box, background and borders are positioned elements; text and everything that draws itself — a
chart, a gauge, a barcode — are inline SVG, because SVG's y is the baseline while a browser places an
HTML inline box's baseline using whatever font it substituted. Each run carries textLength, so a
substituted font changes the glyphs and not the geometry.
Security
A report definition is untrusted input and the consumer of this output is a browser. The projection escapes
every interpolated value, writes no script and no event handlers, and writes a link only when the URL's
scheme is http, https, mailto or absent altogether — a javascript: or data: target is refused
(DXP9501) and carried in the region map marked as not navigable, for a host with its own policy to decide.
Viewer services
ReportHitTestResult? hit = ReportHitTest.At(pages.Pages[0], x, y);
ReportActionTarget where = ReportActionResolver.Resolve(pages, hit!.Action!);
ReportSearchIndex index = ReportSearchIndex.Build(pages);
IReadOnlyList<ReportSearchHit> found = index.Find("revenue");
var session = new ReportViewerSession(instance, fonts);
ReportViewerUpdate update = session.Toggle(toggleKey); // update.ChangedPages says what to redraw
Interactive sort is applied by processing, not by the session: a textbox that offers one is on the page
model and in the region map so a viewer can show the affordance, and reordering a data region is processing
rather than pagination. The viewer puts a ReportInteractiveSort naming the textbox in
ReportRunOptions.InteractiveSorts, processes the report again, and opens a new session over the new
instance.
Requirements
.NET Framework 4.8, .NET Standard 2.0, .NET 8.0 or .NET 10.0. Depends on DocWright.Reporting; no
third-party dependencies.
Documentation
📖 DocWright documentation ·
Show reports in a browser ·
API reference: DocWright.Reporting.Viewer
Contact
Questions, support or licensing: salwan@albahadly.com · www.albahadly.com
License
MIT. See LICENSE and THIRD-PARTY-NOTICES.md in the package.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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 Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- DocWright.Core (>= 1.1.4)
- DocWright.Fonts (>= 1.1.4)
- DocWright.Reporting (>= 1.1.4)
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
.NETStandard 2.0
- DocWright.Core (>= 1.1.4)
- DocWright.Fonts (>= 1.1.4)
- DocWright.Reporting (>= 1.1.4)
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
net10.0
- DocWright.Core (>= 1.1.4)
- DocWright.Fonts (>= 1.1.4)
- DocWright.Reporting (>= 1.1.4)
-
net8.0
- DocWright.Core (>= 1.1.4)
- DocWright.Fonts (>= 1.1.4)
- DocWright.Reporting (>= 1.1.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Guides, tutorials and API reference: https://docs.albahadly.com/docwright/