Back to Devexpress

VCL Reports/Dashboards: How to Use SQLite

vcl-405750-expresscrossplatformlibrary-vcl-backend-database-engines-vcl-backend-sqlite-support.md

latest13.7 KB
Original Source

VCL Reports/Dashboards: How to Use SQLite

  • Apr 06, 2026
  • 5 minutes to read

SQLite is a file-based relational database engine. You can connect TdxDashboard/TdxDashboardControl and TdxReport components to SQLite databases using the TdxBackendDatabaseSQLConnection component. The VCL Backend has built-in support for SQLite (no database provider assembly is required for application deployment).

In this topic…

Sample SQLite Database

This guide uses the following SQLite database shipped with compiled DevExpress VCL demos:

Tip

%PUBLIC%\Documents\DevExpress VCL Demos\MegaDemos\Product Demos\ExpressReports\Data\devav.sqlite3

Download: Compiled VCL Demos

Create & Configure a RAD Studio App Project

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

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:

Configure the SQL Connection Component

The previously added TdxBackendDatabaseSQLConnection component connects to the source SQLite 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:

delphi
uses
  dxDashboard.Control, // Declares the TdxDashboardControl component
  dxBackend.ConnectionString.SQL; // Declares the TdxBackendDatabaseSQLConnection 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 := 'SQLite Database Connection';
  dxBackendDatabaseSQLConnection1.ConnectionString :=

    'XpoProvider=SQLite;' + // Specifies the database engine type
    'Data Source=C:\Users\Public\Documents\DevExpress VCL Demos\MegaDemos\' +
    'Product Demos\ExpressReports\Data\devav.sqlite3';

  dxBackendDatabaseSQLConnection1.Active := True; // Connects to the "devav.sqlite3" database
  dxDashboardControl1.ShowDesigner; // Displays the "Dashboard Designer" dialog
end;
cpp
#include "dxDashboard.Control.hpp" // Declares the TdxDashboardControl component
#include "dxBackend.ConnectionString.SQL.hpp" // Declares the TdxBackendDatabaseSQLConnection component

// Add the following linker directives to the corresponding CPP source file:
#pragma link "dxDashboard.Control" // Required to use dxDashboard.Control.hpp declarations
#if defined(_WIN64) // Required to use dxBackend.ConnectionString.SQL.hpp declarations
  #pragma link "dxBackend.ConnectionString.SQL.o"
#else
  #pragma link "dxBackend.ConnectionString.SQL.obj"
#endif
// ...

void __fastcall TMyForm::cxDisplayDesignerButtonClick(TObject *Sender)
{
  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 = "SQLite Database Connection";
  dxBackendDatabaseSQLConnection1->ConnectionString =

    L"XpoProvider=SQLite;" // Specifies the database engine type
    L"Data Source=C:\\Users\\Public\\Documents\\DevExpress VCL Demos\\MegaDemos\\"
    L"Product Demos\\ExpressReports\\Data\\devav.sqlite3";

  dxBackendDatabaseSQLConnection1->Active = true; // Connects to the "devav.sqlite3" database
  dxDashboardControl1->ShowDesigner(); // Displays the "Dashboard Designer" dialog
}

Tip

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

Build & Run the Test App

The application form contains TdxDashboardControl and TcxButton components:

Build the project and 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:

  3. Copy the following command line:

  4. Paste the DLL deployment command line into the Commands box:

  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:

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

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:

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

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

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

Click Next and use the Run Query Builder… option:

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

If the AVAILABLE TABLES AND VIEWS node contains a list of tables from the sample devav.sqlite3 database, the created SQLite connection is successful.

Next Steps

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

Create a Dashboard Using the Designer DialogCreate 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 WizardCreate 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

VCL Dataset and Data Source ComponentsThe TdxBackendDataSetJSONConnection component allows you to bind TdxDashboard/TdxDashboardControl and TdxReport to one or multiple datasets (TdxMemData, TFDTable, TFDQuery, and other TDataSet descendants) using TDataSource components.In-Memory/Remote Web ServiceThe 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.Microsoft SQL/Azure DatabasesMicrosoft SQL Server and Azure SQL Database are proprietary relational database management systems developed by Microsoft.

Database Providers That Require Assembly Deployment

PostgreSQLPostgreSQL is an open-source database management system.Oracle DatabaseOracle Database is a proprietary multi-model database management system developed by the Oracle Corporation.MySQLMySQL is an open-source relational database management system developed by the Oracle Corporation.FirebirdFirebird is an open-source SQL relational database management system. See Also

VCL Reports/Dashboards: Supported Database Systems

VCL Reports/Dashboards App Deployment