Skip to main content
All docs
V26.1
  • Generate Reports From Prompts (Web Report Designer)

    • 6 minutes to read

    Follow the instructions in this help topic to integrate AI-powered Prompt-to-Report functionality into the Web Report Designer. Once integrated, users can create reports by specifying a prompt (report description in natural language). This tutorial uses Azure OpenAI.

    Web Report Designer - AI Prompt-to-Report Option in Report Designer

    Run Demo: Report Designer AI Extensions

    Note

    This functionality is not supported in the Web Report Designer control for ASP.NET MVC and ASP.NET Web Forms.

    Install NuGet Packages

    Install the following NuGet packages to use Azure OpenAI:

    For the list of supported AI services and their corresponding prerequisites, refer to the Supported AI Services section of the following help topic: AI-powered Extensions for DevExpress Reporting.

    Note

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

    Register AI Service and Activate Extension

    Call the following methods at application startup:

    AddDevExpressAI
    Adds DevExpress AI-related services to the application service collection.
    AddWebReportingAIIntegration
    Adds AI-powered functionality to the Web Document Viewer and Web Report Designer.
    AddPromptToReportConverter()

    Activates AI-powered Prompt-to-Report functionality in the Web Report Designer.

    Use the following methods to specify Prompt-to-Report settings:

    • FixLayoutErrors

      Specifies whether to automatically resolve report control overlapping.

    • SetRetryAttemptCount

      Specifies the number of attempts to fix report layout errors that appear in the LLM response.

    • ConfigurePredefinedPrompts

      Allows you to modify the predefined prompt collection available in the Report Wizard.

    • SetTemperature

      Specifies output randomness. Lower temperatures yield more predictable and focused outputs, while higher temperatures produce more diverse and creative responses.

    • SetPromptAugmentation

      Specifies additional instructions that modify the prompt before processing. The following snippet registers an Azure OpenAI service, activates the AI-powered Prompt-to-Report option in the Report Wizard, adds a custom prompt, and enables the option that automatically resolves control overlapping:

    using Azure.AI.OpenAI;
    using Microsoft.Extensions.AI;
    using System;
    
    // ...
    builder.Services.AddDevExpressControls();
    // ...
    string azureOpenAIEndpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT");
    string azureOpenAIKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY");
    string deploymentName = "MODEL_NAME"
    
    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(aiConfig => {
            aiConfig.AddPromptToReportConverter(options => {
                options.ConfigurePredefinedPrompts(prompts => {
                    prompts.Add(new AIReportPrompt {
                        Title = "Custom Prompt 1",
                        Text = "Custom Prompt Text"
                    });
                })
                .FixLayoutErrors()
                .SetRetryAttemptCount(5);
            });
        });
    });
    

    Disable AI-powered Functionality for a Specific Control

    AI-powered functionality configured within AIReportingConfigurationBuilder is available for all Report Viewer and Report Designer components in the application. If you need to disable this AI-powered functionality for a specific Web Report Designer control, set the client AIServicesEnabled property to false in the BeforeRender event handler. The following snippet disables AI-powered functionality for a Report Designer in an ASP.NET Core application:

    <script type="text/javascript">
        function onBeforeRender(e, s) {
               DevExpress.Reporting.Designer.Settings.AIServicesEnabled(false);
        }
    </script>
    @{
        var designerRender = Html.DevExpress().ReportDesigner("reportDesigner")
            .Height("100%")
            .ClientSideEvents(configure => configure.BeforeRender("onBeforeRender"))
            .Bind(Model);
        @designerRender.RenderHtml()
    }
    

    Generate Reports from Prompts

    Once the functionality is registered, the Report Wizard interface displays the new AI Prompt-to-Report option.

    Select this option to create an AI-generated report.

    Web Report Designer - AI Prompt-to-Report Option

    AI-powered report generation works with two data source options:

    Choose data source option page

    No Data Source

    Creates a complete report structure based only on the user’s natural language description.

    Tip

    You can also use our AI-generated Test Data Source functionality to preview created reports with meaningful data. For more information, refer to the following help topic: Preview Reports with AI-generated Test Data.

    Add Data Source
    Allows users to create a report data source in the first step, displays the data source structure in the Report Wizard interface, and automatically includes this metadata in the LLM prompt. Users can reference available data source fields when they describe data-bound report elements.

    Enter Report Prompt

    Choose a predefined prompt or enter your own prompt. Click Finish.

    Web Report Designer - Add Data Source Option - Enter Report Description Page

    Tip

    You can adjust predefined prompts or create a new prompt from scratch. Review the Configure Predefined Prompts section for more information.

    On the next page, the Wizard analyzes the specified prompt and builds the report:

    Web Report Designer - AI Report Wizard - Building Report

    If input is incomplete or ambiguous, the system may request additional information about the report structure, such as:

    • “What should the report title be?”
    • “Would you like to introduce customer address details in the report: yes/no?”
    • “Please specify page size and orientation for this report. For example, A4, portrait, letter landscape, or custom dimensions.”

      Web Report Designer - AI Report Wizard - Additional Report Details

    The following image illustrates the generated data-bound report and its preview:

    Web Report Designer - AI-generated Data-Bound Report

    Web Report Designer - AI-generated Data-Bound Report Preview

    Configure Report Prompt

    General Tips

    Report generation uses a structured agentic workflow composed of specialized agents. Each agent handles a distinct stage of the pipeline, from intent clarification and input validation to layout planning and output verification.

    Output accuracy depends on the level of detail in the natural-language description. The more detail the user provides about layout preferences, calculations, grouping requirements, and visualization types, the fewer assumptions the model needs to make.

    Users can also describe the report intent in plain language without specifying the exact report structure. In this case, the model may request additional information and adapt the report based on the user’s input to generate a valid layout.

    Call the FixLayoutErrors method to automatically fix report control overlapping. Use the SetRetryAttemptCount method to increase the number of attempts to fix report layout errors that appear in the LLM response. The SetTemperature method allows you to control output randomness.

    Configure Predefined Prompts

    Built-in prompt suggestions show ready-to-use examples. You can use the built-in predefined prompts or create your own prompts.

    Web Report Designer - No Data Source Option - Enter Report Description Page

    Note that prompt changes made in the Report Wizard do not persist.

    To make permanent changes to built-in prompts, use the ConfigurePredefinedPrompts method to access the predefined prompt collection. You can modify prompt “Text” and “Title”, or remove built-in prompts. You can also add custom prompts to the collection.

    Add a New Prompt

    Call the ConfigurePredefinedPrompts method to access the predefined prompt collection (collection of AIReportPrompt objects) and add a new prompt.

    The following code snippet adds a “Custom Prompt” to the predefined prompt collection:

    using DevExpress.AIIntegration.Reporting;
    // ...
    builder.Services.AddDevExpressAI(config => {
        config.AddWebReportingAIIntegration(aiConfig => {
            aiConfig.AddPromptToReportConverter(options => {
                options.ConfigurePredefinedPrompts(prompts => prompts.Add(new AIReportPrompt {
                    Title = "Custom Prompt",
                    Text = "Custom Prompt Text"
                }));
            });
        });
    });
    

    After you add a custom prompt to the collection, the prompt appears in the Report Wizard:

    Web Report Designer - Custom Prompt in Report Wizard