Back to Devexpress

AIReportingExtensions.AddWebReportingAIIntegration(AIWebSettings, Action<AIReportingConfigurationBuilder>) Method

xtrareports-devexpress-dot-aspnetcore-dot-reporting-dot-aireportingextensions-dot-addwebreportingaiintegration-x28-aiwebsettings-action-aireportingconfigurationbuilder-x29.md

latest5.1 KB
Original Source

AIReportingExtensions.AddWebReportingAIIntegration(AIWebSettings, Action<AIReportingConfigurationBuilder>) Method

Provides access to the AIReportingConfigurationBuilder object that exposes methods to register AI-powered extensions for Web Report Designer and Web Document Viewer.

Namespace : DevExpress.AspNetCore.Reporting

Assembly : DevExpress.AIIntegration.AspNetCore.Reporting.v25.2.dll

NuGet Package : DevExpress.AIIntegration.AspNetCore.Reporting

Declaration

csharp
[DXBrowsable(true)]
public static AIWebSettings AddWebReportingAIIntegration(
    this AIWebSettings aiWebSettings,
    Action<AIReportingConfigurationBuilder> configure
)
vb
<DXBrowsable(True)>
<ExtensionAttribute>
Public Shared Function AddWebReportingAIIntegration(
    aiWebSettings As AIWebSettings,
    configure As Action(Of AIReportingConfigurationBuilder)
) As AIWebSettings

Parameters

NameTypeDescription
aiWebSettingsAIWebSettings

Configuration settings for AI-related functionality.

| | configure | Action<AIReportingConfigurationBuilder> |

An Action<T> delegate method that allows you to specify options for the DevExpress AI-powered extension in Web Report Designer and Web Document Viewer.

|

Returns

TypeDescription
AIWebSettings

A AIWebSettings object that can be used to further configure AI-powered functionality.

|

Remarks

You can register AI-powered extensions for Web Report Designer and Web Document Viewer.

The AddDevExpressAI method registers an AI service and adds DevExpress AI-related services to the application service collection. Call methods exposed by the AIReportingConfigurationBuilder class to activate corresponding AI-powered functionality and specify its settings. To access the AIReportingConfigurationBuilder object, call the AddWebReportingAIIntegration method at application startup.

The following code snippet registers an Azure OpenAI chat client and activates the following AI-powered features in an ASP.NET Core application:

  • Summarization for Web Document Viewer and Designer Report Preview
  • Translation to Italian for Web Document Viewer and Designer Report Preview
  • Localization for Web Report Designer
csharp
using Microsoft.Extensions.AI;
using System;

IChatClient chatClient = new AzureOpenAIClient(new Uri(azureOpenAIEndpoint),
     new System.ClientModel.ApiKeyCredential(azureOpenAIKey))
.GetChatClient(deploymentName).AsIChatClient();

builder.Services.AddSingleton(chatClient);
builder.Services.AddDevExpressAI(config => {
    config.AddWebReportingAIIntegration(options => {
        options.AddLocalization()
               .AddSummarization(summarizationOptions =>
                   summarizationOptions.SetSummarizationMode(DevExpress.AIIntegration.SummarizationMode.Abstractive))
               .AddTranslation(translationOptions =>
                   translationOptions
                       .SetLanguages(new List<LanguageInfo> {
                           new LanguageInfo {
                               Text = "Italian",
                               Id = "It"
                           }
                       })
                       .EnableInlineTranslation()
                       .EnableTranslation());
    });
});

See Also

AI-powered Extensions for DevExpress Reporting

Summarize and Translate Reports in Web Document Viewer

AIReportingExtensions Class

AIReportingExtensions Members

DevExpress.AspNetCore.Reporting Namespace