Saving a Dashboard

A dashboard provides the capability to save a dashboard definition (dashboard items, data source, data binding and layout settings, etc.) to an XML file or to a stream, and restore the dashboard from an XML file or a stream.

Saving a Dashboard

Once a dashboard is designed, you can save its definition to the required data store. In the Dashboard Designer, this can be accomplished in the following ways.

  • You can save the dashboard definition by clicking the Save or Save As button in the File group on the Designer ribbon tab.

    SaveButtons

    This invokes the Save As dialog, which allows you to locate the folder in which you wish to store your file.

    Note

    You can handle the DashboardDesigner.DashboardSaving event to implement a custom saving procedure when an end-user clicks one of these buttons, or tries to save the dashboard using a save confirmation dialog.

    Use the Dashboard.SaveToXml method to save the dashboard to an XML file or a stream.

  • The dashboard definition can be saved when the currently opened dashboard is closed (for instance, the window containing the DashboardDesigner is closed, a new dashboard is created or a different dashboard is opened). By default, a save confirmation dialog will be invoked.

    SaveConfirmationDialog

    Use the following methods and properties to manage dialog behavior.

    DashboardDesigner.ActionOnClose

    Gets or sets the required action when the currently opened dashboard is being closed.

    DashboardDesigner.HandleDashboardClosing

    Handles the dashboard close process.

The DashboardDesigner.IsDashboardModified property indicates whether or not the dashboard has been modified since the last save.

You can handle the DashboardDesigner.DashboardClosing event to define the modification state of the dashboard according to your needs.

Loading a Dashboard

A dashboard definition previously saved to an XML file or a stream can be loaded to the Dashboard Designer.

You can open the dashboard definition by clicking the Open button in the Ribbon menu of the Designer.

OpenButton

This invokes the Open File dialog, which allows you to locate the dashboard XML file.

Note

You can handle the DashboardDesigner.DashboardOpening event to override the default Open File dialog and implement custom actions.

To load the dashboard in code, use the DashboardDesigner.LoadDashboard or Dashboard.LoadFromXml method. After the dashboard is opened, the DashboardDesigner.DashboardFileName property is initialized.

Loading Dashboards using the Dashboard Viewer

To load a dashboard definition using the Dashboard Viewer, use the following members.

Windows Forms Viewer

DashboardViewer.LoadDashboard

DashboardViewer.DashboardSource

Loads a dashboard from a stream.

Gets or sets a dashboard supplier for the DashboardViewer.

Web Viewer

ASPxDashboardViewer.DashboardSource

ASPxDashboardViewer.DashboardLoading

Gets or sets a dashboard supplier for the ASPxDashboardViewer.

Allows you to load a dashboard at runtime.

To learn more, see the following topics.

See Also