Skip to main content
All docs
V25.2
  • VCL Reports/Dashboards: How to Use Oracle Databases

    • 5 minutes to read

    Oracle Database is a proprietary multi-model database management system developed by the Oracle Corporation. You can connect TdxDashboard/TdxDashboardControl and TdxReport components to Oracle and MySQL databases using the TdxBackendDatabaseSQLConnection component.

    Configure & Build a RAD Studio App Project

    Create a new project and place TdxDashboardControl and TdxBackendDataConnectionManager components on a form.

    DevExpress Dashboards for Delphi/C++Builder: Create a New ExpressDashboards-Powered Project

    Double-click the TdxBackendDataConnectionManager component on the form to open the Collection Editor dialog, click the Add button, and select the Database (SQL) option to create a TdxBackendDatabaseSQLConnection component:

    DevExpress Dashboards & DevExpress Dashboards for Delphi/C++Builder: Create a SQL Data Connection Component

    Configure the SQL Connection Component

    The previously added TdxBackendDatabaseSQLConnection component connects to the source Oracle database using a connection string. To configure this component and specify a valid connection string, add a TcxButton component to a form and handle the component’s OnClick event as demonstrated in the following code example:

    uses
      dxDashboard.Control,             // Declares the TdxDashboardControl component
      dxBackend.ConnectionString.SQL;  // Declares the TdBackendDatabaseSQLConnection component
    // ...
    
    procedure TMyForm.cxDisplayDesignerButtonClick(Sender: TObject);
    begin
      dxBackendDatabaseSQLConnection1.Active := False;  // Terminates the current connection (if one exists)
      // Specify a user-friendly data connection name (for end-user dialogs) and a valid connection string:
      dxBackendDatabaseSQLConnection1.DisplayName := 'Oracle Database Connection';
      dxBackendDatabaseSQLConnection1.ConnectionString :=
    
        'XpoProvider=Oracle;' +  // Specifies the database engine type
        'Data Source=TORCL;' +   // Specifies the target database
        'User ID=MyUserName;' +  // Specifies a valid user name
        'Password=MyPassword';   // Specifies the corresponding password for the user name
    
      dxBackendDatabaseSQLConnection1.Active := True; // Connects to the test database
      dxDashboardControl1.ShowDesigner;               // Displays the "Dashboard Designer" dialog
    end;
    

    Tip

    Alternatively, you can select the created TdxBackendDatabaseSQLConnection component in the Collection Editor and specify all required settings using the Object Inspector.

    Deploy & Run the Test App

    Obtain & Deploy Dependencies

    1. Open the Oracle.ManagedDataAccess NuGet package page and click Download package.
    2. Rename the downloaded oracle.manageddataaccess.core.23.26.100.nupkg[1] file to oracle.manageddataaccess.core.23.26.100.zip and extract the archive.
    3. Navigate to the following folder: \oracle.manageddataaccess.core.23.26.100\lib\net8.0\. Copy Oracle.ManagedDataAccess.dll.
    4. Create a dotnet_libraries subfolder in the project folder containing the built executable file and paste the copied file into dotnet_libraries.
    5. Place the WebView2Loader.dll file from the EdgeView2 SDK GetIt package into the project folder containing the built executable file.

      Automatic WebView2Loader.dll Deployment

      To automatically place a 32 or 64-bit WebView2Loader.dll file into the target build folder, you must:

      1. Open the Project Options dialog (select the ProjectOptions… item in the RAD Studio menu or press Ctrl + Shift + F11).
      2. Select BuildBuild Events in the tree view pane on the left and select the following option in the Target combo box:

        'All Configurations - All Platforms'

        VCL Shared Libraries: Project Options — Select the Target Platform

      3. Copy the following command line:

        copy /Y "$(BDS)\Redist\$(Platform)\WebView2Loader.dll" $(OUTPUTDIR)
        
      4. Paste the DLL deployment command line into the Commands box:

        VCL Shared Libraries: Paste the DLL Deployment Command Line

      5. Click the Save button to apply pending changes and close the Project Options dialog.

      6. Build the project. Confirm that the configured post-build event is trusted in the following dialog:

        VCL Reports: The "Trust this Project" Dialog

      All build operations in the current RAD Studio project now ensure that the platform-specific WebView2Loader.dll file version is available in the target build folder (for both Debug and Release configurations).

    Run App & Test Database Connection

    The application form contains TdxDashboardControl and TcxButton components:

    DevExpress Dashboards for Delphi/C++Builder: The Test App Form

    Run the built executable file and click the previously added button to display the DevExpress Dashboard Designer dialog. Click the hamburger button, select the Data Sources item, and click the Add link in the DATA SOURCES pane:

    DevExpress Dashboards for Delphi/C++Builder: Dashboard Designer — Data Sources Pane

    Click the Create data source… link in the Add Data Source modal dialog:

    DevExpress Dashboards for Delphi/C++Builder: Dashboard Designer — Add Data Source

    Select Database in the Dashboard Data Source Wizard modal dialog and click Next:

    DevExpress Dashboards for Delphi/C++Builder: Dashboard Designer — Data Source Wizard

    The wizard displays the created data connection component using its display name specified earlier.

    DevExpress Dashboards for Delphi/C++Builder: Dashboard Designer — The Created "Oracle Database Connection" Component

    Click Next and use the Run Query Builder… option:

    DevExpress Dashboards for Delphi/C++Builder: Dashboard Designer — The Run Query Builder Option

    Expand the AVAILABLE TABLES AND VIEWS node to browse tables from the connected database:

    DevExpress Dashboards for Delphi/C++Builder: Dashboard Designer — The Query Builder Populated with Oracle Database Tables

    Next Steps

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

    Create a Dashboard Using the Designer Dialog
    Create a dashboard application: configure Bubble Map and Chart dashboard items, and bind them to data at design time.
    Create a Table Report Using the Report Wizard
    Create a simple report application: define a table report layout and bind it to data using the Report Wizard dialog at design time.

    Other Supported Database Systems

    Refer to the following topics for step-by-step instructions on using corresponding database systems for ExpressReports and ExpressDashboards:

    Built-In Support

    In-Memory/Remote Web Service
    The TdxBackendInMemoryJSONConnection component allows you to bind TdxDashboard/TdxDashboardControl and TdxReport components to JSON data defined in code or loaded from a remote Web API service endpoint.
    SQLite
    SQLite is a file-based relational database engine.
    Microsoft SQL/Azure Databases
    Microsoft SQL Server and Azure SQL Database are proprietary relational database management systems developed by Microsoft.

    Database Providers That Require Assembly Deployment

    PostgreSQL
    PostgreSQL is an open-source database management system.
    MySQL
    MySQL is an open-source relational database management system developed by the Oracle Corporation.
    Firebird
    Firebird is an open-source SQL relational database management system.
    Footnotes
    1. The currently available NuGet assembly version may differ.

    See Also