翻譯|產品更新|編輯:龔雪|2023-11-15 10:42:12.313|閱讀 93 次
概述:界面組件DevExpress Reporting v23.1已經發布一段時間了,新版本在報表查看器中擁有新的縮放選項、發布新的內容安全策略等,歡迎 下載最新版體驗~
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
DevExpress Reporting是.NET Framework下功能完善的報表平臺,它附帶了易于使用的Visual Studio報表設計器和豐富的報表控件集,包括數據透視表、圖表,因此您可以構建無與倫比、信息清晰的報表
界面組件DevExpress Reporting v23.1已經發布一段時間了,新版本在報表查看器中擁有新的縮放選項、發布新的內容安全策略等,歡迎 下載最新版體驗~
DevExpress技術交流群9:909157416 歡迎一起進群討論
新版本改進了對ASP.NET Core應用程序中Web報表組件的內容安全策略支持:您現在可以實現一個基于nonce的CSP,這將允許從DevExpress Web Document Viewer(文檔查看器)和Web Report Designer(報表設計器)的網頁中刪除style-src和script-src指令的不安全內聯關鍵字。
使用新的API從綁定到EFDataSource報表的ASP.NET Core服務器中解析適當的Entity Framework Core上下文。
在依賴注入容器中注冊上下文,調用“Startup”類的ConfigureServices方法中的AddDbContext方法來指定所需的連接字符串。
C#
builder.Services.AddDbContext<OrdersContext>(options => options.UseSqlite("MyConnectionString"), ServiceLifetime.Transient);
實現和接口。
C#
using DevExpress.Data.Entity; using DevExpress.DataAccess.Web; using System; using Microsoft.Extensions.DependencyInjection; // ... public class CustomEFContextProviderFactory : IEFContextProviderFactory { private readonly IServiceProvider serviceProvider; public CustomEFContextProviderFactory(IServiceProvider serviceProvider) { this.serviceProvider = serviceProvider; } public IEFContextProvider Create() { return new CustomEFContextProvider(serviceProvider.CreateScope()); } } public class CustomEFContextProvider : IEFContextProvider, IDisposable { private readonly IServiceScope scope; public CustomEFContextProvider(IServiceScope scope) { this.scope = scope; } public object GetContext(string connectionName, Type contextType) { if(connectionName == "efCoreConnection") return scope.ServiceProvider.GetService(contextType); return null; } public void Dispose() { scope.Dispose(); } }
使用"Startup"類的ConfigureServices()方法來注冊factory實現。
C#
services.ConfigureReportingServices(configurator => { configurator.ConfigureWebDocumentViewer(viewerConfigurator => { viewerConfigurator.RegisterEFContextProviderFactory<CustomEFContextProviderFactory>(); }); });
新的縮放選項包括:
新版本改變了默認的縮放級別,現在是整頁。
新版本中原生的Blazor Report Viewer組件支持Blazor WebAssembly (WASM)托管模型和提前(AOT)編譯,您現在可以在瀏覽器中預覽、打印和導出報表(不需要ASP. NET Core后端)。
我們還用WebAssembly Reporting Application選項擴展了項目模版。
您可以在.NET MAUI應用程序中利用原生Blazor Report Viewer組件的功能,方法是在BlazorWebView中托管該組件。
您可以在iOS和Android的.NET MAUI應用程序中使用DevExpress Reporting工具(生成和導出報表)。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都網