Skip to main content
You are viewing help content for pre-release software. This document and the features it describes are subject to change.
All docs
V26.2
  • Modify Report Behavior in the WPF Report Designer (CTP)

    • 5 minutes to read

    This help topic describes how to integrate the AI-powered Modify Reports functionality into the Report Designer. You can chat with an AI Assistant to modify your report layout. This functionality is available for .NET 10+.

    WPF AI Assistant chat panel

    Important

    The Modify Reports functionality is currently available as a community technology preview (CTP).

    Install NuGet Packages

    This article uses Azure OpenAI. To see NuGet packages required for other supported AI services, refer to AI-powered Extensions.

    Change Project SDK

    Update the project SDK to Microsoft.NET.Sdk.Razor:

    <Project Sdk="Microsoft.NET.Sdk.Razor">
    

    Register AI Client

    Note

    DevExpress AI-powered Extensions follow the “bring your own key” principle. DevExpress does not offer a REST API and does not ship built-in LLMs/SLMs. You need an active Azure/OpenAI subscription to obtain the REST API endpoint, key, and model deployment name. Specify these variables at application startup to register AI clients and enable DevExpress AI-powered Extensions in your application.

    using DevExpress.AIIntegration;
    using DevExpress.Xpf.Core;
    using Azure.AI.OpenAI;
    using Microsoft.Extensions.AI;
    using System.ClientModel;
    using System.Windows;
    
    namespace DXReportsAILocalization {
        public partial class App : Application {
            static App() {
                var container = AIExtensionsContainerDesktop.Default;
    
                IChatClient chatClient = new AzureOpenAIClient(AzureOpenAIEndpoint, AzureOpenAIKey)
                    .GetChatClient(ModelId).AsIChatClient();
    
                container.RegisterChatClient(chatClient);
            }
    
            private static Uri AzureOpenAIEndpoint = new Uri("YOUR_AZURE_OPENAI_END_POINT");
            private static ApiKeyCredential AzureOpenAIKey = new ApiKeyCredential("YOUR_OPENAI_API_KEY");
            static string ModelId = "YOUR_MODEL_NAME"; // For example, "gpt-5.4".
        }
    }
    

    Create and Configure an AI Assistant Behavior

    Attach a ReportModifyBehavior to the Report Designer to enable AI-powered Modify Reports functionality.

    The following settings are available:

    • FixLayoutErrors

      Specifies whether the designer attempts to fix the report layout when report controls overlap.

    • RetryAttemptCount

      Defines the maximum number of attempts to fix report layout errors that may appear in the LLM response. The default value is 3.

    • Temperature

      Controls how creative or deterministic LLM responses are. Lower temperatures (values between 0 and 0.5) yield more predictable and focused outputs. Higher temperatures (values between 0.5 and 1) produce more diverse and creative responses. The default value is 0.

    • Prompt Augmentation

      Specifies additional instructions that modify the prompt before processing.

    • LookupDevExpressDocs

      Specifies whether the AI Assistant searches DevExpress documentation to answer how-to questions about report design. The default value is true. See the following section for details: Ask Questions About the Report Designer.

    Markup:

    xmlns:dxrud="http://schemas.devexpress.com/winfx/2008/xaml/reports/userdesigner" 
    xmlns:dxai="http://schemas.devexpress.com/winfx/2008/xaml/ai" 
    xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"  
    ... 
    <dxrud:ReportDesigner x:Name="reportDesigner" Height="NaN" Width="NaN">
        <dxmvvm:Interaction.Behaviors>
            <dxai:ReportModifyBehavior x:Name="reportModifyBehavior"/>
        </dxmvvm:Interaction.Behaviors>
    </dxrud:ReportDesigner>
    

    Code-Behind:

    using DevExpress.AIIntegration.Wpf.Reporting;
    using DevExpress.Mvvm.UI.Interactivity;
    // ...
    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
            ReportModifyBehavior reportBehavior = new ReportModifyBehavior();
            Interaction.GetBehaviors(reportDesigner).Add(reportBehavior);
        }
    }
    

    Modify Reports

    Once you attach the behavior, the Report Designer interface displays the AI Assistant panel. The AI Assistant panel is unavailable without an active report. Create or open a report to activate the chat panel.

    WPF AI Assistant chat panel

    The chat in the AI Assistant panel allows you to add and modify report elements using natural language. For example, you can execute commands such as:

    • Add/remove report bands

      Add a report header band.
      
    • Add/remove report controls (labels, tables, barcodes, etc.)

      Add a 3x3 table to the Detail band.
      Remove the following controls from the report layout:
      - label1
      - pictureBox1
      
    • Find report controls by name and modify associated properties (text, expression binding, background and foreground colors, etc.)

      Set the xrTable1 table to full width.
      Set column widths as follows:
      - First column: 50%
      - Second column: 25%
      - Third column: 25%
      Set the background color of all cells in the first column to green.
      
    • Modify report properties (margins, paper kind, etc.)

      Modify report settings.
      Margins:
      - Left & Right: 60
      - Top & Bottom: 40
      Report Header:
      - Title: Sample Report
      - Font: Tahoma, 14pt, Bold
      - Alignment: Center
      
    • Group, sort, and filter report data

      Group the report by the "State" field.
      Create a label in the group header. Bind the label to the "State" field.
      

    Note

    The output quality depends on the details you specify in the natural language description. It is also influenced by the underlying language model — including its architecture, size, and training data. Different LLM implementations may yield varying results due to differences in model capabilities.

    Ask Questions About the Report Designer

    The AI Assistant answers how-to questions about report design: Report Designer capabilities, report controls and their settings, and common end-user tasks. You can ask questions such as:

    • How to create a calculated field?
    • How to display a carried-forward total at the bottom of each page?

    The AI Assistant connects to the DevExpress Documentation MCP server, searches documentation, and reads relevant pages. Answers rely on up-to-date documentation rather than on the model’s own knowledge. The AI Assistant takes into account that you use the WPF Report Designer and tailors its answers to the WPF Report Designer UI.

    Set the LookupDevExpressDocs property to false to disable documentation lookup:

    <dxrud:ReportDesigner x:Name="reportDesigner" Height="NaN" Width="NaN">
        <dxmvvm:Interaction.Behaviors>
            <dxai:ReportModifyBehavior LookupDevExpressDocs="False"/>
        </dxmvvm:Interaction.Behaviors>
    </dxrud:ReportDesigner>
    

    The AI Assistant continues to process requests to modify reports if the documentation server is unavailable.