Back to Devexpress

DashboardDesigner.LoadDashboard(String) Method

dashboard-devexpress-dot-dashboardwin-dot-dashboarddesigner-dot-loaddashboard-x28-system-dot-string-x29.md

latest7.7 KB
Original Source

DashboardDesigner.LoadDashboard(String) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Loads a dashboard from an XML file.

Namespace : DevExpress.DashboardWin

Assembly : DevExpress.Dashboard.v25.2.Win.dll

NuGet Package : DevExpress.Win.Dashboard

Declaration

csharp
public void LoadDashboard(
    string filePath
)
vb
Public Sub LoadDashboard(
    filePath As String
)

Parameters

NameTypeDescription
filePathString

A String that specifies the path to an XML file that contains the dashboard.

|

Remarks

You can open a dashboard in one of the following ways.

To save a dashboard to a file or a stream, use the Dashboard.SaveToXml method. You can use the Dashboard.LoadFromXml method to load a dashboard definition from a file or a stream to the existing dashboard.

Note

If the DashboardDesigner / DashboardViewer control is placed in the MDI child form, load dashboards in the Shown event handler instead of Load.

The following code snippet shows how to load a dashboard located in the project’s Data folder:

csharp
dashboardDesigner1.LoadDashboard("../../Data/dashboard1.xml");

The following code snippets (auto-collected from DevExpress Examples) contain references to the LoadDashboard(String) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-async-mode-designer-data-loading/CS/DashboardDesignerAsyncModeExample/Form1.cs#L36

csharp
lblMode.Text = "ASYNC";
    dashboardDesigner1.LoadDashboard("test.xml");
}

winforms-dashboard-display-best-and-worst-monthly-sales/CS/Dashboard_AggrSalesByMonths/Form1.cs#L8

csharp
dashboardDesigner1.CreateRibbon();
    dashboardDesigner1.LoadDashboard(@"..\..\Data\SalesByMonths.xml");
}

winforms-dashboard-custom-save-and-open-procedures/CS/Dashboard_LoadingAndSaving/Form1.cs#L34

csharp
DevExpress.DashboardWin.DashboardOpeningEventArgs e) {
dashboardDesigner1.LoadDashboard(filePath);
e.Handled = true;

winforms-dashboard-localize-stringid-visualizer/CS/WinForms_Localizer/WinForms_Localizer/DesignerForm1.cs#L18

csharp
InitializeComponent();
dashboardDesigner.LoadDashboard(@"..\..\Dashboards\dashboard1.xml");

winforms-dashboard-customize-exported-document/CS/CustomExportDocumentExample/Form1.cs#L16

csharp
dashboardDesigner1.ConfigureDataConnection += DashboardDesigner1_ConfigureDataConnection;
dashboardDesigner1.LoadDashboard("Dashboard.xml");
dashboardDesigner1.ExportToExcel("test.xlsx");

winforms-dashboard-async-mode-designer-data-loading/VB/DashboardDesignerAsyncModeExample/Form1.vb#L36

vb
lblMode.Text = "ASYNC"
    dashboardDesigner1.LoadDashboard("test.xml")
End Sub

winforms-dashboard-display-best-and-worst-monthly-sales/VB/Dashboard_AggrSalesByMonths/Form1.vb#L11

vb
dashboardDesigner1.CreateRibbon()
    dashboardDesigner1.LoadDashboard("..\..\Data\SalesByMonths.xml")
End Sub

winforms-dashboard-custom-save-and-open-procedures/VB/Dashboard_LoadingAndSaving/Form1.vb#L34

vb
Private Sub dashboardDesigner1_DashboardOpening(ByVal sender As Object, ByVal e As DevExpress.DashboardWin.DashboardOpeningEventArgs) Handles dashboardDesigner1.DashboardOpening
    dashboardDesigner1.LoadDashboard(filePath)
    e.Handled = True

winforms-dashboard-localize-stringid-visualizer/VB/WinForms_Localizer/WinForms_Localizer/DesignerForm1.vb#L14

vb
InitializeComponent()
    dashboardDesigner.LoadDashboard("..\..\Dashboards\dashboard1.xml")
End Sub

winforms-dashboard-customize-exported-document/VB/CustomExportDocumentExample/Form1.vb#L15

vb
AddHandler dashboardDesigner1.ConfigureDataConnection, AddressOf DashboardDesigner1_ConfigureDataConnection
dashboardDesigner1.LoadDashboard("Dashboard.xml")
dashboardDesigner1.ExportToExcel("test.xlsx")

Implements

LoadDashboard(String)

See Also

DashboardDesigner Class

DashboardDesigner Members

DevExpress.DashboardWin Namespace