TdxCustomDashboardControl.DashboardName Property
Specifies the dashboard name.
Declaration
property DashboardName: string read; write;
Property Value
| Type | Description |
|---|---|
| string | The dashboard name. |
Remarks
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.
Code Examples
Save Dashboard Layout to File on Every Change
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;
Save Dashboard State to File in Response to User Changes
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;
Related GitHub-Hosted Example Projects
Default Value
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.