Skip to main content
All docs
V25.1
  • AIReportPromptCollection Class

    A collection of predefined prompts displayed in the Report Wizard.

    Namespace: DevExpress.AIIntegration.Reporting

    Assembly: DevExpress.AIIntegration.Reporting.Common.v25.1.dll

    NuGet Package: DevExpress.AIIntegration.Reporting.Common

    Declaration

    public class AIReportPromptCollection :
        List<AIReportPrompt>

    Remarks

    Multiple built-in DevExpress prompt suggestions ship with the AI-powered Prompt-to-Report (CTP) functionality. You can review them to create your own prompts. For example, check the “Prompt Template” entry - a basic template you can customize. You can set up page layout, styles, fields, and functions. Other templates describe common report types, like invoices. These prompts are stored in AIReportPromptCollection and automatically appear in the Report Wizard after registering a ReportPromptToReportBehavior.

    To change built-in DevExpress prompts, call the AIReportPromptCollection.GetDefaultReportPrompts() method and access the desired prompt. Modify prompt Text and Title.

    using DevExpress.AIIntegration.WinForms.Reporting;
    // ...
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
            behaviorManager1.Attach<ReportPromptToReportBehavior>(reportDesigner1, behavior => {
              var collection = AIReportPromptCollection.GetDefaultReportPrompts();
              collection[0].Text = "your custom text";
              behavior.Properties.PredefinedPrompts = collection;
            });
        }
    }
    

    The following code snippet obtains built-in DevExpress prompts from AIReportPromptCollection, creates a custom prompt (an AIReportPrompt object), and adds this prompt to the collection. The collection is assigned to the ReportPromptToReportBehaviorProperties.PredefinedPrompts property.

    using DevExpress.AIIntegration.WinForms.Reporting;
    // ...
    public partial class Form1 : Form {
        public Form1() {
            behaviorManager1.Attach<ReportPromptToReportBehavior>(reportDesigner1, behavior => {
                // Obtain built-in DevExpress prompts from the collection.
                var collection = AIReportPromptCollection.GetDefaultReportPrompts();
                // Create a custom prompt.
                AIReportPrompt customPrompt = new AIReportPrompt();
                customPrompt.Title = "Custom Prompt";
                customPrompt.Text = Prompts.CustomAIReportPrompt;
                // Add this prompt to the collection.
                collection.Add(customPrompt);
                // Display Prompts in the Report Wizard.
                behavior.Properties.PredefinedPrompts = collection;
            });
        }
        public static class Prompts {
            public const string CustomAIReportPrompt = "Create Sample Report:\r\n \r\nPage Setup:\r\n- Paper Size: A4\r\n- Report Margins:\r\n - Top & Bottom: 40\r\n - Left & Right: 60\r\n\r\nReport Header:\r\n- Title: Sample Report\r\n- Alignment: Center\r\n- Font: Comic Sans MS, 12pt, Bold\r\n\r\nCreate a horizontal table with the four column headers that correspond to fields in the bound data source.\r\n\r\nFont for column headers: Comic Sans MS, 12pt, Bold\r\n \r\nDetail Section:\r\nBind data cells to the fields corresponding to the column headers defined in the Group Header\r\nFont for data cells: Comic Sans MS, 12pt, Bold\r\n \r\nSummary Section:\r\nInclude calculated values for bound fields.\r\nSummary type: [Sum]\r\nFont for summary values: Comic Sans MS, 12pt, Bold";
        // ...
        }
    }
    

    The following image illustrates the result:

    Inheritance

    Object
    List<AIReportPrompt>
    AIReportPromptCollection
    See Also