Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

AIServicesEnabled Function

Enables AI-powered Summarize and Translate features in the Web Document Viewer.

#Declaration

TypeScript
export const AIServicesEnabled: DevExpress.Analytics.Internal.IGlobalSubscribableValue<boolean>

#Parameters

Name Type Description
newVal boolean

true to enable the AI-powered features; otherwise, false.

#Returns

Type
boolean

#Remarks

To enable the DevExpress AI-powered extension for the Web Document Viewer, call the AddWebReportingAIIntegration on application startup and set the AIServicesEnabled property to true on the client.

For additional information, refer to the following article: Summarize and Translate Reports in the Web Document Viewer.

#Example

The following code snippets enable the DevExpress AI-powered Extension for the Web Document Viewer in an ASP.NET Core application:

  1. In the Program.cs file, call the AddDevExpressAI and AddWebReportingAIIntegration methods to register an AI service.

    cs
    using Microsoft.Extensions.AI;
    using System;
    
    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.AddWebReportingAIIntegration(options =>
            options.SummarizationMode = SummarizationMode.Abstractive);
    });
    
  2. On the page with the Document Viewer, set the AIServicesEnabled property to true and use the AILanguages property to specify languages for Summarize and Translate operations:

    cshtml
    <script>
        function OnInitializing(e, s) {
            DevExpress.Reporting.Viewer.Settings.AIServicesEnabled(true);
            DevExpress.Reporting.Viewer.Settings.AILanguages([
                { key: 'en', text: 'English' },
                { key: 'es', text: 'Spanish' },
                { key: 'de', text: 'German' }
            ]);
        }
    </script>
    
    @{
        var viewerRender = Html.DevExpress().WebDocumentViewer("DocumentViewer")
            .ClientSideEvents((configure) => { configure.OnInitializing("OnInitializing"); })
            .Height("100%")
            .Bind(Model);
        @viewerRender.RenderHtml()
    }
    

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

AI Operations tab AI-powered Quick Actions
Web Document Viewer -- AI Operations Tab Web Document Viewer -- AI-powered Context Menu Actions

The AI Operations tab allows you to do the following:

  • 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

The Quick Actions menu allows 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