Skip to main content
All docs
V24.2

AIReportingExtensions.AddBlazorReportingAIIntegration(AIWebSettings, Action<DxBlazorReportingAIOptions>) Method

Adds AI-powered functionality to the Blazor Report Viewer.

Namespace: DevExpress.Blazor.Reporting

Assembly: DevExpress.AIIntegration.Blazor.Reporting.Viewer.v24.2.dll

NuGet Package: DevExpress.AIIntegration.Blazor.Reporting.Viewer

Declaration

public static void AddBlazorReportingAIIntegration(
    this AIWebSettings aiWebSettings,
    Action<DxBlazorReportingAIOptions> configureOptions
)

Parameters

Name Type Description
aiWebSettings AIWebSettings
configureOptions Action<DxBlazorReportingAIOptions>

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

Remarks

To enable the DevExpress AI-powered extension for Blazor Report Viewer, call the AddBlazorReportingAIIntegration. Use DevExpress.Blazor.Reporting.DxBlazorReportingAIOptions* to specify the following options for Summarize and Translate operations:

SummarizationMode
Specifies the summarization mode.
Languages
Specifies the language collection for Translate and Summarize operations.

The following code snippet registers an Azure OpenAI service and enables the DevExpress AI-powered extension for the Report Viewer:

using Azure;
using Microsoft.Extensions.AI;
using DevExpress.Blazor.Reporting;

// ....
string azureOpenAIEndpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT");
string azureOpenAIKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY");
string deploymentName = "gpt4o";
//...
IChatClient asChatClient = new Azure.AI.OpenAI.AzureOpenAIClient(new Uri(AzureOpenAIEndpoint),
     new System.ClientModel.ApiKeyCredential(AzureOpenAIKey))
.AsChatClient("GPT4o");
builder.Services.AddSingleton(asChatClient);
builder.Services.AddDevExpressAI(config => {
    config.AddBlazorReportingAIIntegration(options => {
        options.AvailableLanguages = new List<LanguageItem>() {
            new LanguageItem() { Key = "de", Text = "German" },
            new LanguageItem() { Key = "en", Text = "English" }
        };
        options.SummarizationMode = SummarizationMode.Abstractive;
    });
});

The AI Operations tab appears in the tab panel and AI-powered context menu items are available to users:

The AI Operations tab The AI-powered context menu actions
Blazor Report Viewer -- AI Operations Tab Blazor Report Viewer -- AI-powered Context Menu Actions

The AI Operations tab allows you to:

  • Select input text range for Summarize and Translate operations (Document, Selected Pages, or Selected Report Content)
  • Select a language for Summarize and Translate operations
  • Review and copy operation output

Context menu actions allow you to summarize and translate selected report content. Operation output is displayed in the AI Operations tab.

You can now translate and summarize any report using AI-powered tools.

See Also