This example shows how to create a custom dashboard storage that allows storing dashboards in a data base. It uses the System.Data.SqlClient members to connect and operate an MS SQL server data base.
A custom dashboard storage should implement one of the following interfaces: IDashboardStorage or IEditableDashboardStorage.
IDashboardStorage provides functionality to open and edit dashboards available in the storage.
XDocument LoadDashboard(string dashboardID) - returns a dashboard by its ID in the XDocument format, which describes an object model of the dashboard.
IEnumerable<DashboardInfo> GetAvailableDashboardsInfo() - returns a list of IDs and Captions of dashboards available in the data storage.
void SaveDashboard(string dashboardID, XDocument dashboard) - updates the dashboard with new settings by its id.
IEditableDashboardStorage inherits the IDashboardStorage interface and contains one additional method that allows adding new dashboards to the storage.
string AddDashboard(XDocument dashboard, string dashboardName) - takes a dashboard definition with its caption, saves it to the data storage, and returns the ID of a new saved dashboard.
Additionally, this example contains an SQL Server data base backup file and SQL query, which can be used to recreate a data base used in this example on your side.
See also: How to save dashboards created in ASPxDashboardDesigner to a DataSet.
This example applies to the Web Dashboard Designer starting from v2016 vol 1. To learn how to achieve this goal in previous versions, refer to the OBSOLETE - ASPxDashboardDesigner - How to save dashboards to a data base example.
↧
ASPxDashboardDesigner - How to save dashboards to a data base
↧