vcl-dxdashboard-dot-control-dot-tdxcustomdashboardcontrol-f595c037.md
Specifies the dashboard name.
property DashboardName: string read; write;
| Type | Description |
|---|---|
| string |
The dashboard name.
|
Use the DashboardName property to define a dashboard layout name for export operations when the Layout property contains a non-empty dashboard layout. Dashboard Viewer and Dashboard Designer dialogs also display the DashboardName property value in the form caption.
The ExportTo procedure returns a string (as the AFileName parameter) that consists of the DashboardName property value with the file name extension associated with the target export format.
The following code example saves the current dashboard layout to an XML file every time a user saves pending changes in the Dashboard Designer dialog:
uses
dxDashboard.Control; // Declares the TdxDashboardControl component
// ...
procedure TMyForm.dxDashboardControl1LayoutChanged(ASender: TdxCustomDashboardControl);
begin
ASender.Layout.SaveToFile(ASender.DashboardName + '.xml');
end;
#include "dxDashboard.Control.hpp" // Declares the TdxDashboardControl component
// Add the following linker directive to the corresponding CPP source file:
#pragma link "dxDashboard.Control" // Required to use dxDashboard.Control.hpp declarations
// ...
void __fastcall TMyForm::dxDashboardControl1LayoutChanged(TdxCustomDashboardControl *ASender)
{
ASender->Layout->SaveToFile(ASender->DashboardName + ".xml");
}
The following code example saves the current dashboard user interaction state to a JSON file on every change:
uses
dxDashboard.Control; // Declares the TdxDashboardControl component
// ...
procedure TMyForm.dxDashboardControl1StateChanged(ASender: TdxCustomDashboardControl);
begin
ASender.State.SaveToFile(ASender.DashboardName + 'State.json');
end;
#include "dxDashboard.Control.hpp" // Declares the TdxDashboardControl component
// Add the following linker directive to the corresponding CPP source file:
#pragma link "dxDashboard.Control" // Required to use dxDashboard.Control.hpp declarations
// ...
void __fastcall TMyForm::dxDashboardControl1StateChanged(TdxCustomDashboardControl *ASender)
{
ASender->State->SaveToFile(ASender->DashboardName + "State.json");
}
View Example: Store Dashboard Layouts in a Database
The DashboardName property’s default value is an empty string.
The default DashboardName property value indicates that the ShowDesigner procedure displays an empty dashboard layout, even if the Layout property contains a non-empty layout. Any subsequent saved changes made in the Dashboard Designer dialog update both DashboardName and Layout property values.
See Also
TdxCustomDashboardControl Class