diff --git a/CPB/uData.dfm b/CPB/uData.dfm index 1b4b1cb..dbba129 100644 --- a/CPB/uData.dfm +++ b/CPB/uData.dfm @@ -174,12 +174,6 @@ object DataModule1: TDataModule1 end end end - object dxSkinController1: TdxSkinController - NativeStyle = False - SkinName = 'WXI' - Left = 288 - Top = 84 - end object mdRevenueByIndustry: TdxMemData Active = True Indexes = <> diff --git a/CPB/uData.h b/CPB/uData.h index 826aa89..beadafd 100644 --- a/CPB/uData.h +++ b/CPB/uData.h @@ -26,7 +26,6 @@ class TDataModule1 : public TDataModule TdxBackendDataConnectionManager *dxBackendDataConnectionManager1; TdxBackendDataSetJSONConnection *RevenueByIndustryConnection; TdxBackendDataSetCollectionItem *RevenueByIndustryConnectionItem1; - TdxSkinController *dxSkinController1; TdxMemData *mdRevenueByIndustry; TStringField *mdRevenueByIndustryCity; TStringField *mdRevenueByIndustryIndustry; diff --git a/CPB/uMainForm.cpp b/CPB/uMainForm.cpp index 338b523..97fbf7a 100644 --- a/CPB/uMainForm.cpp +++ b/CPB/uMainForm.cpp @@ -40,6 +40,12 @@ #pragma link "dxAI" #pragma link "dxAI.Commands.SmartPaste" #pragma link "cxTextEdit" +#pragma link "cxColorComboBox" +#pragma link "cxContainer" +#pragma link "cxDBColorComboBox" +#pragma link "cxDropDownEdit" +#pragma link "cxMaskEdit" +#pragma link "dxLayoutcxEditAdapters" #pragma resource "*.dfm" TMainForm *MainForm; //--------------------------------------------------------------------------- diff --git a/CPB/uMainForm.dfm b/CPB/uMainForm.dfm index 7cdd414..7edd770 100644 --- a/CPB/uMainForm.dfm +++ b/CPB/uMainForm.dfm @@ -65,16 +65,23 @@ object MainForm: TMainForm DataBinding.FieldName = 'RecId' Visible = False end - object gvLayoutsLayout: TcxGridDBColumn - Caption = 'Report Layout' - DataBinding.FieldName = 'Layout' - Options.Editing = False - end object gvLayoutsName: TcxGridDBColumn - Caption = 'Report Name' + Caption = 'Dashboard Name' DataBinding.FieldName = 'Name' PropertiesClassName = 'TcxTextEditProperties' Properties.OnValidate = gvLayoutsNamePropertiesValidate + Width = 246 + end + object gvLayoutsLayout: TcxGridDBColumn + Caption = 'Dashboard Layout' + DataBinding.FieldName = 'Layout' + Options.Editing = False + Width = 275 + end + object gvLayoutsColumn1: TcxGridDBColumn + Caption = 'Dashboard State' + DataBinding.FieldName = 'State' + Width = 269 end end object cxGrid2Level1: TcxGridLevel @@ -178,8 +185,4 @@ object MainForm: TMainForm Index = 2 end end - object dxReport1: TdxReport - Left = 48 - Top = 88 - end end diff --git a/CPB/uMainForm.h b/CPB/uMainForm.h index 446cd6e..d6b6bfd 100644 --- a/CPB/uMainForm.h +++ b/CPB/uMainForm.h @@ -45,6 +45,12 @@ #include "dxAI.Commands.SmartPaste.hpp" #include "dxAI.hpp" #include "cxTextEdit.hpp" +#include "cxColorComboBox.hpp" +#include "cxContainer.hpp" +#include "cxDBColorComboBox.hpp" +#include "cxDropDownEdit.hpp" +#include "cxMaskEdit.hpp" +#include "dxLayoutcxEditAdapters.hpp" //--------------------------------------------------------------------------- class TMainForm : public TForm { @@ -67,7 +73,7 @@ class TMainForm : public TForm TdxLayoutItem *liBtnNew; TdxLayoutGroup *lgButtons; TdxLayoutItem *liBtnDelete; - TdxReport *dxReport1; + TcxGridDBColumn *gvLayoutsState; void __fastcall btnNewDashboardClick(TObject *Sender); void __fastcall btnDeleteClick(TObject *Sender); void __fastcall btnDesignClick(TObject *Sender); diff --git a/Delphi/uData.dfm b/Delphi/uData.dfm index 1b4b1cb..dbba129 100644 --- a/Delphi/uData.dfm +++ b/Delphi/uData.dfm @@ -174,12 +174,6 @@ object DataModule1: TDataModule1 end end end - object dxSkinController1: TdxSkinController - NativeStyle = False - SkinName = 'WXI' - Left = 288 - Top = 84 - end object mdRevenueByIndustry: TdxMemData Active = True Indexes = <> diff --git a/Delphi/uData.pas b/Delphi/uData.pas index d8f9dac..828e30c 100644 --- a/Delphi/uData.pas +++ b/Delphi/uData.pas @@ -15,7 +15,6 @@ TDataModule1 = class(TDataModule) mdLayoutsLayout: TBlobField; mdLayoutsName: TWideStringField; dxBackendDataConnectionManager1: TdxBackendDataConnectionManager; - dxSkinController1: TdxSkinController; mdRevenueByIndustry: TdxMemData; mdRevenueByIndustryCity: TStringField; mdRevenueByIndustryIndustry: TStringField; diff --git a/Delphi/uMainForm.dfm b/Delphi/uMainForm.dfm index 151991f..7edd770 100644 --- a/Delphi/uMainForm.dfm +++ b/Delphi/uMainForm.dfm @@ -20,6 +20,8 @@ object MainForm: TMainForm Align = alClient TabOrder = 0 AutoSize = True + ExplicitWidth = 837 + ExplicitHeight = 519 object btnDesign: TcxButton Left = 287 Top = 12 @@ -63,16 +65,23 @@ object MainForm: TMainForm DataBinding.FieldName = 'RecId' Visible = False end - object gvLayoutsLayout: TcxGridDBColumn - Caption = 'Report Layout' - DataBinding.FieldName = 'Layout' - Options.Editing = False - end object gvLayoutsName: TcxGridDBColumn - Caption = 'Report Name' + Caption = 'Dashboard Name' DataBinding.FieldName = 'Name' PropertiesClassName = 'TcxTextEditProperties' Properties.OnValidate = gvLayoutsNamePropertiesValidate + Width = 246 + end + object gvLayoutsLayout: TcxGridDBColumn + Caption = 'Dashboard Layout' + DataBinding.FieldName = 'Layout' + Options.Editing = False + Width = 275 + end + object gvLayoutsColumn1: TcxGridDBColumn + Caption = 'Dashboard State' + DataBinding.FieldName = 'State' + Width = 269 end end object cxGrid2Level1: TcxGridLevel @@ -84,7 +93,6 @@ object MainForm: TMainForm Top = 184 Width = 819 Height = 340 - Parameters = <> TabOrder = 4 OnLayoutChanged = dxDashboardControl1LayoutChanged OnStateChanged = dxDashboardControl1StateChanged @@ -177,9 +185,4 @@ object MainForm: TMainForm Index = 2 end end - object dxReport1: TdxReport - Parameters = <> - Left = 48 - Top = 88 - end end diff --git a/Delphi/uMainForm.pas b/Delphi/uMainForm.pas index d0cf0a1..b1fb90b 100644 --- a/Delphi/uMainForm.pas +++ b/Delphi/uMainForm.pas @@ -16,7 +16,6 @@ interface type TMainForm = class(TForm) - dxReport1: TdxReport; btnNewDashboard: TcxButton; btnDesign: TcxButton; btnDelete: TcxButton; @@ -35,6 +34,7 @@ TMainForm = class(TForm) liBtnDelete: TdxLayoutItem; liGrid: TdxLayoutItem; liDashboardControl: TdxLayoutItem; + gvLayoutsColumn1: TcxGridDBColumn; procedure btnNewDashboardClick(Sender: TObject); procedure btnDesignClick(Sender: TObject); procedure btnDeleteClick(Sender: TObject); diff --git a/README.md b/README.md index 19469af..a2be1d1 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ This example application allows users to create new layouts/modify existing layo 1. Create additional layouts if necessary. 1. Close and restart the app. Click on grid records to switch between dashboard layouts you set up previously. - Press **Design Dashboard** or **Delete Dashboard** to modify or delete entries. + Click **Design Dashboard** or **Delete Dashboard** to modify or delete entries. ![DevExpress Dashboards for Delphi/C++Builder — Store Dashboard Layout Definitions in a Database](./images/vcl-dashboards-store-layout-template-database.gif) @@ -118,7 +118,7 @@ end; To load a different dashboard in the Dashboard Control, assign a new dashboard name and layout. -The assigned dashboard replaces the current layout definition and resets the dashboard state. +The assigned layout definition replaces the current definition and resets the dashboard state. You can also clear the Dashboard Control using [TdxCustomDashboardControl.Clear]. @@ -238,7 +238,7 @@ end; - [Introduction to DevExpress Dashboards for Delphi/C++Builder][dashboards-intro] - [Tutorial: Create a dashboard using the Designer Dialog][designer] -- [Use JSON as a data source for dashboards (as demonstrated in the current example)][json-data-source] +- [Reports/Dashboards for Delphi/C++Builder: Supported Database Systems][supported-dbms] - [Save the dashboard layout to file on every change (code example)][save-to-file] - API reference: - [TdxCustomDashboardControl] (used to display a dashboard on an application form) @@ -256,7 +256,7 @@ end; [dashboards-intro]: https://docs.devexpress.com/VCL/405642/ExpressDashboards/vcl-dashboards [designer]: https://docs.devexpress.com/VCL/405774/ExpressDashboards/getting-started/create-dashboard-using-designer-dialog -[json-data-source]: https://docs.devexpress.com/VCL/405747/ExpressCrossPlatformLibrary/vcl-backend/database-engines/vcl-backend-memory-based-data-storage +[supported-dbms]: https://docs.devexpress.com/VCL/405703/ExpressCrossPlatformLibrary/vcl-backend/vcl-backend-supported-database-systems [save-to-file]: https://docs.devexpress.com/VCL/dxDashboard.Control.TdxCustomDashboardControl.Layout#save-dashboard-layout-to-file-on-every-change [supported-dbms]: https://docs.devexpress.com/VCL/405703/ExpressCrossPlatformLibrary/vcl-backend/vcl-backend-supported-database-systems diff --git a/images/vcl-dashboard-layout-database-sample-app.png b/images/vcl-dashboard-layout-database-sample-app.png index 7773a9f..f0281d1 100644 Binary files a/images/vcl-dashboard-layout-database-sample-app.png and b/images/vcl-dashboard-layout-database-sample-app.png differ