Quantcast
Channel: Developer Express Inc.
Viewing all articles
Browse latest Browse all 2389

DevExpress Reporting — Early Access Preview (v24.2) — Important Changes, SVG-based Preview Rendering, AI-Powered Enhancements and New Barcodes

$
0
0

Our next major update (v24.2) is set for release in early December. This post details DevExpress Reports-related features we expect to ship in December and describes what’s included in our early access preview (EAP v24.2) build. I encourage all active DevExpress Universal and DXperience subscribers to download and install our EAP and share thoughts/opinions with us via the DevExpress Support Center.

If you own an active Universal/DXperience subscription and are ready to install the EAP, simply navigate to the DevExpress Download Manager to obtain the EAP build.

Early Access and CTP builds are provided solely for early testing purposes and are not ready for production use. This build can be installed side by side with other major versions of DevExpress products. Please back up your project and other important data before installing Early Access and CTP builds.

This EAP may not include all features/products we expect to ship in our v24.2 release cycle. As its name implies, the EAP offers an early preview of what we expect to ship in two months. For additional information on what you can expect, refer to our DevExpress Reporting Roadmap v24.2

Important Changes in v24.2

Pango-based Cross-Platform Drawing Engine End-Of-Life

Because of our commitment to .NET 8 and following the release of our cross-platform SkiaSharp-based engine last year, we have refactored our source code to remove all GDI+ related method calls for non-Windows environments (libgdiplus) and our Pango-based engine.

We will discontinue the availability of the DevExpress.CrossPlatform.Printing.DrawingEngine package once .NET 9 is released. We encourage you to migrate to the SkiaSharp-based DevExpress Drawing Graphics library if you are deploying DevExpress Reports-powered apps to non-Windows environments. Refer to the following help topic for additional information/guidance: Use DevExpress Reporting on macOS and Linux.

AzureCompatibility Property for Windows Apps Environment Has Been Deprecated

Multiple DevExpress products (Reporting, BI Dashboard, and Office File API) ship with printing and data export functionality for restricted environments such as Microsoft Azure (where certain GDI/GDI+ calls related to metafiles and font objects are unavailable). The AzureCompatibility.Enable property manages this functionality.

In our v23.2 release cycle, we ended support for capabilities offered by this property toggle for non-Windows environments. With v24.2, we will phase out this toggle for Windows environments as well. We recommend that you use our Skia-based Cross-Platform Graphics Engine if targeting cloud/restricted environments.

.NET Framework 4.6.2 and .NET 8 Support

With this release, minimally supported framework and IDE versions will be as follows:

  • .NET 4.6.2
  • .NET 8
  • Visual Studio 2019

Learn more about this global change in the following announcement: .NET — .NET 8 and .NET Framework 4.6.2 Are Minimally Supported Target Frameworks for DevExpress Libraries in v24.2

Web Report Viewer — SVG Preview

The DevExpress Web Document Viewer will ship with a PreviewRenderFormat property (to enable SVG-based print preview functionality).

Use the PreviewRenderFormat property to specify preview rendering format: SVG or PNG. SVG allows users to preview reports with the highest fidelity - maximizing sharpness and clarity at any zoom level.

One of the advantages of this enhancement is its ability to reduce the Web Report Viewer's memory footprint when transferring report page data between the server and client. Our tests indicate that this improvement is most pronounced when zoom level is set above 100%. When rendering mode switches to vector images, zooming is managed by the browser. This approach eliminates the need to make additional requests to the reporting backend to re-render the report and it introduces native text selection within the viewer.

Additionally, we have added a PageRenderFormat.Auto value for the PreviewRenderFormat property. With this option, the Web Report Viewer automatically switches its rendering mode to SVG when the document zoom exceeds 100% (to optimize performance in multi-page mode). In single-page mode, pages are rendered in SVG.

To illustrate the difference in rendering quality, refer to the following screenshots (comparing bitmap and SVG rendering modes at a zoom level of 500%).

Web Report Viewer & Blazor Report Viewer — AI-Powered Enhancements

You can now integrate AI-powered Summarize and Translate features into the DevExpress ASP.NET Core Web Report Viewer and Blazor Report Viewer. New UI elements allow users to review "core insights" associated with a given report (using Generative AI summaries) and translate report documents/pages/selected content to a desired language using AI-powered translation tools.

Web Report Viewer — AI Enhacements

DevExpress does not offer a REST API or ship any built-in LLMs/SLMs. To use this feature, you need to have an active subscription to Azure/Open AI and obtain the REST API endpoint, key, and model deployment name. These variables must be specified at runtime to enable DevExpress AI-Powered Extensions in your application.

To get started, your project must meet the following prerequisites:

To enable new AI-powered features within the DevExpress Web Report Viewer, you must: 

  • Add the following NuGet packages:
    • DevExpress.AIIntegration.AspNetCore.Reporting
    • DevExpress.AIIntegration.Azure.OpenAI or DevExpress.AIIntegration.OpenAI based on AI service preferences.
  • Call the AddDevExpressAI method at application startup to register AI services:

Program.cs

using DevExpress.AIIntegration;
...
string azureOpenAIEndpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT");
string azureOpenAIKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY");
string deploymentName = "YourModelDeploymentName"
...
builder.Services.AddDevExpressAI((config) => {
    config.RegisterChatClientOpenAIService
        new AzureOpenAIClient(
            new Uri(azureOpenAIEndpoint),
            new AzureKeyCredential(azureOpenAIKey)
        ), deploymentName);
        
    //for Web Report Viewer and ASP.NET Core 
    config.AddDevExpressWebReportingAIIntegration(reportingAI => {
        reportingAI.SummarizeBehavior = SummarizeBehavior.Abstractive;
    });
    //for Blazor Report Viewer
    //config.AddBlazorReportingAIIntegration(config => {
    //config.SummarizeBehavior = SummarizeBehavior.Abstractive;
    //config.AvailabelLanguages = new List<LanguageItem>() {
    //    new LanguageItem() { Key = "de", Text = "German" },
    //    new LanguageItem() { Key = "en", Text = "English" }
    //};
})
  • Open the view with the DevExpress Web Report Viewer and handle its OnInitializing event as follows:
@model DevExpress.XtraReports.Web.WebDocumentViewer.WebDocumentViewerModel
<script>
    function OnInitializing(e, s) {
        DevExpress.Reporting.Viewer.Settings.AIServicesEnabled(true);
        DevExpress.Reporting.Viewer.Settings.AILanguages([
            { key: 'en', text: 'English' },
            { key: 'de', text: 'German' }
        ]);
    }
</script>
@{
    var viewerRender = Html.DevExpress().WebDocumentViewer("DocumentViewer")
        .ClientSideEvents((configure) => { configure.OnInitializing("OnInitializing"); })
        .Height("100%")
        .Bind(Model);
    @viewerRender.RenderHtml()
}

Please refer to the following GitHub repositories to download code examples:

Web Report Viewer — AI Integration Examples

We have added two new examples that showcase the capabilities of our AI-focused APIs (by integrating Open AI Asisstants into the DevExpress Web Report Viewer and DevExpress Web End-User Report Designer). These examples also highlight the use of the brand-new DevExtreme JavaScript DxChat component.

The first example embeds a Copilot-inspired chat window within the DevExpress Web Report Viewer. As you would expect, users can ask natural language questions to analyze data and obtain AI-powered insights. 

DevExpress Web Report Viewer — Chat with Your Data

Similarly, our second example embeds a virtual assistant in the DevExpress Web End-User Report Designer. This allows users to ask natural language questions regarding the report design process. 

DevExpress Web Report Designer — AI Assistant

Please refer to the following GitHub repository to download the examples listed above: Web Reporting – Integrate AI Assistants.

Native Report Viewer for Blazor — Shortcuts for Windows and macOS

We have updated the list of shortcuts for the Blazor Report Viewer to prevent conflicts with default system/browser shortcuts. Additionally, we have introduced new shortcuts for macOS (utilizing the Command () key).

Please refer to the following help topic for additional information: Keyboard Shortcuts.

Native Report Viewer for Blazor — Report Parameter Validation

You can now handle the ParameterRequestValueChanged event to implement validation rules for report parameter editors in the DevExpress Blazor Report Viewer.

The code snippet below handles the ParametersRequestValueChanged event and applies the following validation rules to report parameters:

  • String parameters must not allow empty values
  • Integer parameters must be greater than 42
  • The start date in date range parameters must be in 2024.
@page "/reportviewer/"

@using DevExpress.Blazor.Reporting
@using DevExpress.XtraReports.Parameters
@using DevExpress.XtraReports.UI

<link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.css" rel="stylesheet" />
<link href="_content/DevExpress.Blazor.Reporting.Viewer/css/dx-blazor-reporting-components.bs5.css" rel="stylesheet" />

<DxReportViewer @ref="reportViewer" Report="Report" />

@code {
    DxReportViewer reportViewer;
    XtraReport Report { get; set; }

    protected override  async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
            Report = new TestReport();
            Report.ParametersRequestValueChanged += OnParameterRequestValueChanged;
        }
        await reportViewer.OpenReportAsync(Report);
    }

 void OnParameterRequestValueChanged(object sender, ParametersRequestValueChangedEventArgs e)
 {
     //Check for string parameters and ensure they are not empty.
     if (e.ChangedParameterInfo?.Parameter.Type == typeof(String) && string.IsNullOrEmpty(e.ChangedParameterInfo?.Value.ToString()))
     {
         e.ErrorText = "String parameters do not allow empty values.";
     }
     
     //Check for integer parameters and ensure they are greater than 42.
     else if (e.ChangedParameterInfo?.Parameter.Type == typeof(int) && Int32.Parse(e.ChangedParameterInfo.Value.ToString()) <= 42)
     {
         e.ErrorText = "The value must be greater than 42.";
     }
     
     //Check for date range parameters and ensure the start date is within 2024.
     else if ((e.ChangedParameterInfo?.Parameter?.ValueSourceSettings as RangeParametersSettings) != null)
     {
         Range<DateTime> dateRange = (Range<DateTime>)e.ChangedParameterInfo.Value;
         if (dateRange.Start < new DateTime(2024, 1, 1) || dateRange.Start > new DateTime(2024, 12, 31))
         {
             e.ErrorText = "The start date must be in 2024.";
         }
     }
 }

If validation fails, the parameter editor is outlined in red, and an error message is displayed on screen:

Blazor Report Viewer – Parameters Validation

New Aztec Barcode

We extended barcode support and now allow you to generate the Aztec code. Aztec barcodes offer a compact/efficient way to encode large amounts of data without requiring a quiet zone, making them ideal for space-constrained documents.

To create the Aztec Barcode, set the XRBarCode.Symbology property value to AztecCode and specify appropriate barcode properties:

DevExpress Report Designer — Aztec Barcode

You can also specify barcode data using Text or BinaryData properties as follows:

using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
// ...

XRBarCode barCode = new XRBarCode();
barCode.Symbology = new AztecCodeGenerator();
barCode.Text = "YourData";
//OR
//barCode.BinaryData = GetAztecCodeData();

New Micro QR Code

You can now create Micro QR Codes (a smaller alternative to traditional QR Codes). Micro QR Codes are suitable for space-limited documents, where only small amounts of data (35 characters or 128 bits) require encoding.

To create a Micro QR Code, set the XRBarCode.Symbology property value to MicroQRCode and specify appropriate barcode properties:

DevExpress Report Designer — Micro QR Code

You can also specify barcode data using Text or BinaryData properties as follows:

using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
// ...

XRBarCode barCode = new XRBarCode();
barCode.Symbology = new MicroQRCodeGenerator();
barCode.Text = "123ABC";
//OR
//barCode.BinaryData = GetMicroCodeData();

Export Enhancements

HTML Export — Preserve Rotated Text

The XRLabel control now preserves text rotation defined by its Angle property (supported angles are 90 degrees, 180 degrees, and 270 degrees, and their negative counterparts) when exporting reports to HTML files.

PDF Export — Export Bookmarks

The new PdfExportOptions.ExportBookmarks property allows you to control bookmark visibility in exported PDF documents.

Resolve Missing Fonts

We added a new DXFontRepository.QueryNotFoundFont event for fonts used within a document but missing in an application’s hosting environment. This feature allows you to identify and resolve missing fonts by adding them to DXFontRepository before document generation begins (using the e.FontFileData event argument). In the following code snippet, we use Google Fonts to locate/add fonts to DXFontRepository :

DXFontRepository.QueryNotFoundFont+= QueryNotFoundFont;

void QueryNotFoundFont(object sender, NotFoundFontEventArgs e) {
    var service = new FontCollectorService();
    var fontData = service.ProcessFont(e.RequestedFont).Result;
    e.FontFileData = fontData;
}

With this enhancement, you will be able to identify and address document appearance issues, ensuring that reports appear as designed, regardless of the hosting platform.

Our components will also log font names in the application output for debugging purposes. Please review the following example for additional information: Reporting for WinForms - Add missing fonts into DXFontRepository from Google.

Your Feedback Matters

We value your feedback. Please take a moment to respond to the following survey and let us know how we can best serve your Reporting-related needs now and into the future:

Should you encounter an issue while using this Early Access Preview build (v24.2), please submit a support ticket via the DevExpress Support Center. 


Viewing all articles
Browse latest Browse all 2389

Trending Articles