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.1
  • Use Report Viewer Project and Form Templates

    • 6 minutes to read

    The VCL Template Kit ships with automatically installed Project and Form templates for the ExpressReports Suite. These templates are designed to reduce time spent on repetitive project and form setup as well as improve onboarding for new VCL developers and boost productivity in experienced teams.

    VCL Reports: Run and Test the Generated App

    Before You Begin

    Note

    Ensure that your development environment meets ExpressDashboards and ExpressReports prerequisites:

    1. Microsoft Windows 10 or newer.
    2. Embarcadero RAD Studio IDE 12.3 or newer (Community Edition IDEs are not supported).
    3. DevExpress VCL v26.1.x.
    4. The EdgeView2 SDK package installed from the GetIt package manager.

    Project Template

    The Report Viewer Application template creates a single-form application project that contains a TdxReportControl component.

    To run the Application/Project Wizard, select the following item in the RAD Studio IDE menu:

    FileNewDevExpress VCL v26.1 Application/Project - Delphi

    VCL Reports — RAD Studio Menu Items for the VCL Template Kit

    VCL Reports: The "Report Viewer Application" Template

    Select Report Viewer Application in the Reporting & Data Analytics category and click Create Project.

    Result: Generated Project

    The TdxReportControl component occupies the main form area (the component’s Align property is set to alClient). The generated form is derived from the TdxForm class and encapsulates all best practices regarding app building for high-DPI multi-monitor environments.

    VCL Reports: A Generated Report Viewer Project Example

    App Deployment Settings

    The generated Report Viewer project includes a Windows 32-bit build target, including all preconfigured post-build events required for automatic WebView2 Loader deployment:

    VCL Reports: Project Settings for the Generated Project

    Tip

    You may need to manually add an extra build target (Windows 64-bit) and/or additional resources and dependencies according to your business needs and desired app functionality. Refer to the following help topics for detailed information in this regard:

    VCL Reports/Dashboard App Deployment

    Sample Data and Layout

    The TdxReportControl component is empty at design time. The generated project includes the main form’s OnCreate event handler that creates a TdxBackendInMemoryJSONConnection component to load a sample JSON data file (OrderDetails.json) located within the nested Data project folder.

    The same handler loads a sample dashboard layout from the TableReport.repx file located within the same Data folder.

    Run & Test the App

    Build and run the generated project. Use built-in UI elements to navigate between report pages, print, and export report content (in any supported format).

    VCL Reports: Run and Test the Generated App

    Form Template

    The Report Viewer Form template allows you to add a configured DevExpress form with a TdxReportControl component to an existing application.

    To run the Form/User Control Wizard, select the following item in the RAD Studio IDE menu:

    FileNewDevExpress VCL v26.1 Application/Project - Delphi

    VCL Reports — RAD Studio Menu Items for the VCL Template Kit

    VCL Reports: The "Report Viewer Form" Template

    Result: Generated Form

    The template creates a child form derived from the TdxForm class. The TdxReportControl component occupies the form’s area similar to the main form created by the Report Viewer Application template.

    Sample Data, Layout, and Deployment

    The added form loads the same sample data and layout on form creation as the Report Viewer Application template. If the target project does not include post-build events required for WebView2 Loader deployment, the form template adds them automatically.

    Use the Generated Form

    The form template does not automatically associate the generated form with existing app functionality. You need to manually display the form in code. For example:

    uses
      uChildForm;  // Adds the generated form's unit explicitly
    
    procedure TMainForm1.cxReportDisplayButton1Click(Sender: TObject);
    begin
      ChildForm.Show;  // Displays the generated form
    end;
    

    Application Builder Options

    Application Builder is a universal application template that allows you to choose/combine multiple target business scenarios, and different UI layouts and navigation options. You can add one or multiple views with pre-configured DevExpress UI controls based on project requirements.

    The Application Builder template wizard contains two steps:

    Step 1 — Select Navigation Type

    This step allows you to select a navigation UI type (sidebar and/or tabbed MDI layout) designed to switch between multiple Views on the same application form:

    VCL Reports: Select a Navigation UI Type in the "Application Builder" Template

    Scroll the Application Builder pane down to select required Views (Step 2).

    Step 2 — Add Views to the Application

    Step 2 lists multiple options that allow you to add one or multiple Views dedicated to corresponding DevExpress UI controls.

    VCL Reports: Select Views in the "Application Builder" Template

    All available options are grouped into the following categories: All, Grid, TreeList, Chart, Reporting & Data Analysis, Scheduler, Word, Excel, and PDF. Select Reporting & Data Analytics to display Report and Dashboard Views.

    VCL Reports: The "Reporting & Data Analytics" Category in the "Application Builder" Template

    You can click individual Views to select or deselect them. All selected Views are added to the generated project once you click Create Project.

    Result: Generated Project

    The generated project includes a TdxNavBar control as a sidebar and selected View forms displayed as frames. Each View includes a Ribbon UI.

    VCL Reports: A Multi-View Application Example

    Individual application Views use the same sample data and layouts as corresponding standalone project templates. Similar to standalone Report and Dashboard templates, the Application Builder template automatically adds post-build events required for WebView2 Loader deployment.

    Next Steps

    Review the following tutorials to get started with TdxReport and TdxReportControl components:

    Read Tutorial: Create a Table Report
    Basic Tutorial. Follow this tutorial to create a table report and display it in a VCL application. The tutorial loads JSON data from a remote source, defines a table report layout, and binds it to data using the Report Wizard dialog at design time.
    Read Tutorial: Bind a Report to FireDAC Data
    Follow this tutorial to create a table report and bind it to data using standard FireDAC components (TFDQuery and TFDConnection) shipped with the RAD Studio IDE.
    Read Tutorial: Bind a Report to a Stored Procedure
    Follow this tutorial to create a table report, bind it to a stored database procedure, and pass a report parameter to that procedure using Report Designer and Report Wizard dialogs at design time.
    See Also