Skip to main content
All docs
V25.1
  • AIReportingExtensions.AddBlazorReportingAIIntegration(AIWebSettings, Action<AIReportingConfigurationBuilder>) Method

    Provides access to the AIReportingConfigurationBuilder object that exposes methods to register AI-powered extensions for Blazor Report Viewer.

    Namespace: DevExpress.Blazor.Reporting

    Assembly: DevExpress.AIIntegration.Blazor.Reporting.Viewer.v25.1.dll

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

    Declaration

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

    Parameters

    Name Type Description
    aiWebSettings AIWebSettings

    Configuration settings for AI-related functionality.

    configureOptions Action<AIReportingConfigurationBuilder>

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

    Returns

    Type Description
    AIWebSettings

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

    Remarks

    You can register AI-powered extensions for Blazor Report 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 AddBlazorReportingAIIntegration method at application startup.

    The following code snippet registers an Azure OpenAI chat client and activates the following AI-powered Summarization and Translation features:

    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.AddBlazorReportingAIIntegration(options => {
            options.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