Add DevExpress Reporting and Custom Report Storage

Updated project dependencies to include DevExpress Reporting and PDF Drawing libraries. Registered DevExpress services and middleware in `Program.cs`. Added `CustomReportStorageWebExtension` to handle read-only invoice reports, including database and file system integration. Enhanced logging for better traceability and error handling.
This commit is contained in:
OlgunR
2026-06-08 08:38:44 +02:00
parent 6dd1fd71da
commit f19251ac1a
3 changed files with 137 additions and 2 deletions

View File

@@ -1,11 +1,19 @@
using DXApp.TemplateKitProject.Data;
using DXApp.TemplateKitProject.DevExpressExtensions;
using DXApp.TemplateKitProject.Services;
using Microsoft.EntityFrameworkCore;
using DevExpress.AspNetCore;
using DevExpress.AspNetCore.Reporting;
using DevExpress.XtraReports.Web.Extensions;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();
// DevExpress Controls und Reporting Services
builder.Services.AddDevExpressControls();
builder.Services.AddScoped<ReportStorageWebExtension, CustomReportStorageWebExtension>();
// Datenbank
var connectionString = builder.Configuration.GetConnectionString("EcmContext")
?? throw new InvalidOperationException("Connection string 'EcmContext' not found.");
@@ -30,12 +38,18 @@ if (!app.Environment.IsDevelopment())
app.UseHttpsRedirection();
// MIME-Types für PDF.js registrieren (einmaliger UseStaticFiles-Aufruf)
// MIME-Types für PDF.js UND DevExpress registrieren
var provider = new Microsoft.AspNetCore.StaticFiles.FileExtensionContentTypeProvider();
provider.Mappings[".mjs"] = "text/javascript";
provider.Mappings[".ftl"] = "text/plain";
provider.Mappings[".woff2"] = "font/woff2";
provider.Mappings[".woff"] = "font/woff";
app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = provider });
// DevExpress Middleware
app.UseDevExpressControls();
app.UseRouting();
app.UseAuthorization();
app.MapRazorPages();