Back to Devexpress

TdxCustomDashboardControl.Layout Property

vcl-dxdashboard-dot-control-dot-tdxcustomdashboardcontrol-562a94ff.md

latest5.8 KB
Original Source

TdxCustomDashboardControl.Layout Property

Provides access to the dashboard layout (in XML).

Declaration

delphi
property Layout: TStringList read;

Property Value

TypeDescription
TStringList

Stores the current dashboard layout (as XML strings).

|

Remarks

A dashboard layout definition contains data visualization items, properties, data bindings, and general layout information. You can use the Layout property to load, save, and access the dashboard layout.

Design-Time Functionality

The following design-time edit options are available for the Layout property value:

Dashboard Designer

A double-click on a TdxDashboardControl component on a form displays the Web Dashboard dialog for the component (in Designer Mode).

String List Editor

Click the ellipsis button to the right of the Layout property in the Object Inspector to display a text editor.

You can use this editor to paste an XML layout definition from a different source or edit the current dashboard layout directly.

Note

If a dashboard UI/layout definition is set/specified at design time, the Layout property stores the XML layout in a DFM project file.

Available Options

Call Layout.LoadFromFile/Layout.LoadFromStream and Layout.SaveToFile/Layout.SaveToStream procedures to import and export configured dashboard layouts in the XML format.

In addition, you can use Layout.Strings and Layout.Text properties to access and modify dashboard layout content directly (if required).

Refer to the TStringList class description for detailed information on all available options.

End-User Layout Edit Functionality

Call the ShowDesigner procedure to display the Web-Based [Dashboard Designer] dialog.

All changes made in this dialog update the Layout property value and raise the OnLayoutChanged event[1]. For example, you can handle this event to save dashboard layout changes to a file or stream.

Tip

Refer to the following topic for detailed information on all tools available for dashboard layout creation: Create Dashboards on the Web.

Dashboard User Interaction States

The State property provides access to the dashboard/user interaction state that includes filter criteria, drill-down values, the active tab page, dashboard parameter values, individual data visualization item states, and other configuration options set by users.

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");
}

Related GitHub-Hosted Example Projects

View Example: Store Dashboard Layouts in a Database

Footnotes

  1. The OnLayoutChanged event occurs on every Layout property value change.

See Also

TdxCustomDashboardControl.Clear Procedure

TdxReport.Layout Property

TdxCustomDashboardControl Class

TdxCustomDashboardControl Members

dxDashboard.Control Unit