The requested page is not available for the requested platform. You are viewing the content for Default platform.

How to: Create an ASP.NET Web Forms Dashboard Designer Application

  • 3 min to read

This example shows how to create a Web Dashboard Designer application and provide data for dashboards.

The project contains a simple dashboard and two available data sources: the XML and OLAP data sources. You can use these data sources to create a new dashboard. To learn how to create a Web Designer application from scratch, see the following topic: Create an ASP.NET Web Forms Designer.

Note that the OLAP data source requires the ADOMD.NET data provider installed on the web server. You can get the latest version of this provider here:

using System;
using System.Web.Hosting;
using DevExpress.DashboardCommon;
using DevExpress.DashboardWeb;
using DevExpress.DataAccess.ConnectionParameters;
using DevExpress.DataAccess.Sql;

namespace Dashboard_WebDashboard_2010 {
    public partial class WebForm1 : System.Web.UI.Page {
        protected void Page_Load(object sender, EventArgs e) {
            #region #DashboardStorage
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");
            #endregion #DashboardStorage

            #region #DataSourceStorage
            DashboardSqlDataSource sqlDataSource = new DashboardSqlDataSource("SQL Data Source", "sqlConnection");
            SelectQuery countriesQuery = SelectQueryFluentBuilder
                .SelectColumns("Country", "Latitude", "Longitude", "Year", "EnergyType", "Production", "Import")

            DashboardOlapDataSource olapDataSource = new DashboardOlapDataSource("OLAP Data Source", "olapConnection");

            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();
            dataSourceStorage.RegisterDataSource("sqlDataSource1", sqlDataSource.SaveToXml());
            dataSourceStorage.RegisterDataSource("olapDataSource1", olapDataSource.SaveToXml());
            #endregion #DataSourceStorage

        protected void ASPxDashboard1_ConfigureDataConnection(object sender, ConfigureDataConnectionWebEventArgs e) {
            if (e.ConnectionName == "sqlConnection") {
                string databasePath = HostingEnvironment.MapPath("~/App_Data/DashboardEnergyStatictics.xml");
                e.ConnectionParameters = new XmlFileConnectionParameters(databasePath);