Back to Devexpress

TdxCustomDashboardControl.DashboardName Property

vcl-dxdashboard-dot-control-dot-tdxcustomdashboardcontrol-f595c037.md

latest4.2 KB
Original Source

TdxCustomDashboardControl.DashboardName Property

Specifies the dashboard name.

Declaration

delphi
property DashboardName: string read; write;

Property Value

TypeDescription
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:

delphi
uses
  dxDashboard.Control; // Declares the TdxDashboardControl component
// ...

procedure TMyForm.dxDashboardControl1LayoutChanged(ASender: TdxCustomDashboardControl);
begin
  ASender.Layout.SaveToFile(ASender.DashboardName + '.xml');
end;
cpp
#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");
}

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:

delphi
uses
  dxDashboard.Control; // Declares the TdxDashboardControl component
// ...

procedure TMyForm.dxDashboardControl1StateChanged(ASender: TdxCustomDashboardControl);
begin
  ASender.State.SaveToFile(ASender.DashboardName + 'State.json');
end;
cpp
#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");
}

Related GitHub-Hosted Example Projects

View Example: Store Dashboard Layouts in a Database

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.

See Also

TdxReport.ReportName Property

TdxCustomDashboardControl Class

TdxCustomDashboardControl Members

dxDashboard.Control Unit