Add DevExpress Document Viewer page and dependencies
Updated `_ViewImports.cshtml` to include DevExpress and DevExtreme tag helpers. Created `DocumentViewerDevExpress.cshtml` for displaying a DevExpress Document Viewer with necessary CDN links. Implemented the corresponding code-behind in `DocumentViewerDevExpress.cshtml.cs` to handle model binding and report key generation.
This commit is contained in:
@@ -0,0 +1,32 @@
|
|||||||
|
@page
|
||||||
|
@model DXApp.TemplateKitProject.Pages.Invoices.DocumentViewerDevExpressModel
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "DevExpress Document Viewer";
|
||||||
|
}
|
||||||
|
|
||||||
|
@* Dev: Für schnelle Tests verwenden wir die CDN-Assets.
|
||||||
|
In Production bitte lokal hosten und Lizenz einbinden. *@
|
||||||
|
<link rel="stylesheet" href="https://cdn3.devexpress.com/jslib/25.2.7/css/dx.common.css" />
|
||||||
|
<link rel="stylesheet" href="https://cdn3.devexpress.com/jslib/25.2.7/css/dx.light.css" />
|
||||||
|
<script src="https://cdn3.devexpress.com/jslib/25.2.7/js/dx.all.js"></script>
|
||||||
|
<script src="https://cdn3.devexpress.com/jslib/25.2.7/js/dx.aspnet.data.js"></script>
|
||||||
|
|
||||||
|
<div class="container-fluid" style="height:100vh; padding:0;">
|
||||||
|
<div class="d-flex align-items-center justify-content-between p-3 border-bottom">
|
||||||
|
<h5 class="m-0">DevExpress Viewer — Rechnung @Model.Id</h5>
|
||||||
|
<div>
|
||||||
|
<a class="btn btn-secondary me-2" href="/Invoices">Zurück zur Übersicht</a>
|
||||||
|
<a class="btn btn-outline-secondary" href="/Invoices/DocumentViewer?id=@Model.Id">Baseline Viewer</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="height:calc(100vh - 64px);">
|
||||||
|
@* KORRIGIERTE SYNTAX: Der WebDocumentViewer-Helper wird direkt aufgerufen. *@
|
||||||
|
@(Html.DevExpress().WebDocumentViewer()
|
||||||
|
.Name("WebDocumentViewer")
|
||||||
|
.Height("100%")
|
||||||
|
.Width("100%")
|
||||||
|
.Bind(Model.ReportKey)
|
||||||
|
)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
|
namespace DXApp.TemplateKitProject.Pages.Invoices;
|
||||||
|
|
||||||
|
public class DocumentViewerDevExpressModel : PageModel
|
||||||
|
{
|
||||||
|
[BindProperty(SupportsGet = true)]
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public string ReportKey => $"invoice-{Id}";
|
||||||
|
|
||||||
|
public void OnGet()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,10 @@
|
|||||||
@using DXApp.TemplateKitProject
|
@using DXApp.TemplateKitProject
|
||||||
|
@using DXApp.TemplateKitProject.Pages
|
||||||
@namespace DXApp.TemplateKitProject.Pages
|
@namespace DXApp.TemplateKitProject.Pages
|
||||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
|
|
||||||
|
@* --- DevExpress & DevExtreme Integration --- *@
|
||||||
|
@using DevExpress.AspNetCore
|
||||||
|
@using DevExpress.AspNetCore.Reporting
|
||||||
@using DevExtreme.AspNet.Mvc
|
@using DevExtreme.AspNet.Mvc
|
||||||
|
@addTagHelper *, DevExtreme.AspNet.Core
|
||||||
Reference in New Issue
Block a user