protected void Page_Load(object sender, EventArgs e)
        {
            //DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");
            //ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);

            ASPxDashboard1.SetDashboardStorage(SessionDashboardStorage.Instance);

            ASPxDashboard1.CustomExport += (s, args) => {
                ChartConstantLinesExtension.CustomExport(args);
            };
            // Uncomment this string to allow end users to create new data sources based on predefined connection strings.
            //ASPxDashboard1.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider());

            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            ASPxDashboard1.ConfigureItemDataCalculation += (s, args) => {
                args.CalculateAllTotals = true;
            };
            // Registers an SQL data source.
            DashboardSqlDataSource sqlDataSource = new DashboardSqlDataSource("SQL Data Source", "NWindConnectionString");
            SelectQuery            query         = SelectQueryFluentBuilder
                                                   .AddTable("SalesPerson")
                                                   .SelectAllColumns()
                                                   .Build("Sales Person");

            sqlDataSource.Queries.Add(query);
            dataSourceStorage.RegisterDataSource("sqlDataSource", sqlDataSource.SaveToXml());

            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");

            ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);

            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            using (Workbook workbook = new Workbook()) {
                Directory
                .EnumerateFiles(HostingEnvironment.MapPath(@"~/App_Data/ExcelFiles/"), "*.xlsx")
                .SelectMany(file => {
                    workbook.LoadDocument(file);
                    return(workbook.Worksheets.Select(sheet => {
                        var dataSourceId = string.Format("{0} - {1}", Path.GetFileNameWithoutExtension(file), sheet.Name);
                        var excelDataSource = new DashboardExcelDataSource(dataSourceId);
                        excelDataSource.ConnectionName = dataSourceId;
                        excelDataSource.FileName = file;
                        var worksheetSettings = new ExcelWorksheetSettings()
                        {
                            WorksheetName = sheet.Name
                        };
                        excelDataSource.SourceOptions = new ExcelSourceOptions(worksheetSettings);
                        return new {
                            Name = excelDataSource.Name,
                            Xml = excelDataSource.SaveToXml()
                        };
                    }));
                })
                .ToList()
                .ForEach(ds => dataSourceStorage.RegisterDataSource(ds.Name, ds.Xml));
            }
            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");

            ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);

            // Uncomment this string to allow end users to create new data sources based on predefined connection strings.
            //ASPxDashboard1.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider());

            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            // Registers an SQL data source.
            DashboardSqlDataSource sqlDataSource = new DashboardSqlDataSource("SQL Data Source", "NWindConnectionString");
            SelectQuery            query         = SelectQueryFluentBuilder
                                                   .AddTable("SalesPerson")
                                                   .SelectAllColumns()
                                                   .Build("Sales Person");

            sqlDataSource.Queries.Add(query);
            dataSourceStorage.RegisterDataSource("sqlDataSource", sqlDataSource.SaveToXml());

            // Registers an Object data source.
            DashboardObjectDataSource objDataSource = new DashboardObjectDataSource("Object Data Source");

            dataSourceStorage.RegisterDataSource("objDataSource", objDataSource.SaveToXml());

            // Registers an Excel data source.
            DashboardExcelDataSource excelDataSource = new DashboardExcelDataSource("Excel Data Source");

            excelDataSource.FileName      = HostingEnvironment.MapPath(@"~/App_Data/Sales.xlsx");
            excelDataSource.SourceOptions = new ExcelSourceOptions(new ExcelWorksheetSettings("Sheet1"));
            dataSourceStorage.RegisterDataSource("excelDataSource", excelDataSource.SaveToXml());

            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data");
            //ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);

            DashboardFileStorage dashboard = new DashboardFileStorage(GetVirtualPath(Server.MapPath("~/Dashboards")));

            ASPxDashboard1.SetDashboardStorage(dashboard);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage storage = new DashboardFileStorage(dashboardsPath);

            ASPxDashboard1.SetDashboardStorage(storage);
            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            dataSourceStorage.RegisterDataSource(DataSourceGenerator.CreateNWindDataSource().SaveToXml());
            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");

            ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);

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

            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            dataSourceStorage.RegisterDataSource("olapDataSource", olapDataSource.SaveToXml());
            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");

            ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);

            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();
            DashboardObjectDataSource objDataSource     = new DashboardObjectDataSource("Object Data Source", typeof(SalesPersonData));

            dataSourceStorage.RegisterDataSource("objDataSource", objDataSource.SaveToXml());
            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);

            ASPxDashboard1.ServiceContainer.AddService(typeof(IObjectDataSourceCustomFillService), new CustomObjectDataSourceCustomFillService());
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");

            ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);

            DashboardObjectDataSource objDataSource = new DashboardObjectDataSource("Object Data Source");

            objDataSource.DataId     = "odsSales";
            objDataSource.DataSource = typeof(SalesPersonData);
            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            dataSourceStorage.RegisterDataSource("objDataSource", objDataSource.SaveToXml());
            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage newDashboardStorage = new DashboardFileStorage(HostingEnvironment.MapPath(@"~/App_Data/Dashboards"));

            ASPxDashboard1.SetDashboardStorage(newDashboardStorage);

            ASPxDashboard1.SetConnectionStringsProvider(new ConfigFileConnectionStringsProvider());
            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            DashboardExtractDataSource extractDataSource = new DashboardExtractDataSource("Extract Data Source");

            extractDataSource.ConnectionName = "edsSales";
            dataSourceStorage.RegisterDataSource("extractDataSource", extractDataSource.SaveToXml());
            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");

            ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);

            // Creates an Excel data source and selects the specific cell range from the SalesPerson worksheet.
            DashboardExcelDataSource excelDataSource = new DashboardExcelDataSource("Excel Data Source");

            excelDataSource.ConnectionName = "xlsProducts";
            excelDataSource.FileName       = HostingEnvironment.MapPath(@"~/App_Data/ExcelDataSource.xlsx");
            ExcelWorksheetSettings worksheetSettings = new ExcelWorksheetSettings("SalesPerson", "A1:L2000");

            excelDataSource.SourceOptions = new ExcelSourceOptions(worksheetSettings);

            // Specifies the fields that will be available for the created data source.
            IExcelSchemaProvider schemaProvider = excelDataSource.GetService(typeof(IExcelSchemaProvider))
                                                  as IExcelSchemaProvider;

            FieldInfo[] availableFields = schemaProvider.GetSchema(excelDataSource.FileName, null,
                                                                   ExcelDocumentFormat.Xlsx, excelDataSource.SourceOptions, System.Threading.CancellationToken.None);
            List <string> fieldsToSelect = new List <string>()
            {
                "CategoryName", "ProductName", "Country", "Quantity",
                "Extended Price"
            };

            foreach (FieldInfo field in availableFields)
            {
                if (fieldsToSelect.Contains(field.Name))
                {
                    excelDataSource.Schema.Add(field);
                }
                else
                {
                    field.Selected = false;
                    excelDataSource.Schema.Add(field);
                }
            }

            // Adds the created data source to the data source storage.
            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            dataSourceStorage.RegisterDataSource("excelDataSource", excelDataSource.SaveToXml());
            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");

            ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);

            // Uncomment this string to allow end users to create new data sources based on predefined connection strings.
            //ASPxDashboard1.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider());

            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            // Configures an SQL data source.
            DashboardSqlDataSource sqlDataSource = new DashboardSqlDataSource("SQL Data Source", "NWindConnectionString");
            SelectQuery            query         = SelectQueryFluentBuilder
                                                   .AddTable("Orders")
                                                   .SelectAllColumnsFromTable()
                                                   .Build("SQL Orders");

            sqlDataSource.Queries.Add(query);

            // Configures an Object data source.
            DashboardObjectDataSource objDataSource = new DashboardObjectDataSource("Object Data Source");

            objDataSource.DataId = "odsInvoices";

            // Configures an Excel data source.
            DashboardExcelDataSource excelDataSource = new DashboardExcelDataSource("Excel Data Source");

            excelDataSource.ConnectionName = "excelSales";
            excelDataSource.FileName       = HostingEnvironment.MapPath(@"~/App_Data/SalesPerson.xlsx");
            excelDataSource.SourceOptions  = new ExcelSourceOptions(new ExcelWorksheetSettings("Data"));

            // Configures a JSON data source.
            DashboardJsonDataSource jsonDataSource = new DashboardJsonDataSource("JSON Data Source");

            jsonDataSource.ConnectionName = "jsonCategories";
            Uri fileUri = new Uri(HostingEnvironment.MapPath(@"~/App_Data/Categories.json"), UriKind.RelativeOrAbsolute);

            jsonDataSource.JsonSource = new UriJsonSource(fileUri);

            // Registers a Federated data source.
            dataSourceStorage.RegisterDataSource("federatedDataSource", CreateFederatedDataSource(sqlDataSource,
                                                                                                  excelDataSource, objDataSource, jsonDataSource).SaveToXml());

            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");

            ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);

            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            DashboardObjectDataSource dataSource = new DashboardObjectDataSource("Data");

            dataSource.DataId        = "odsSales";
            dataSource.ComponentName = "objData";
            dataSource.DataSource    = typeof(ViewModel);
            dataSource.DataMember    = "CreateData";
            dataSourceStorage.RegisterDataSource(dataSource.ComponentName, dataSource.SaveToXml());

            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");

            ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);

            DashboardSqlDataSource sqlDataSource = new DashboardSqlDataSource("SQL Data Source", "access97Connection");
            SelectQuery            query         = SelectQueryFluentBuilder
                                                   .AddTable("SalesPerson")
                                                   .SelectAllColumns()
                                                   .Build("Sales Person");

            sqlDataSource.Queries.Add(query);

            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            dataSourceStorage.RegisterDataSource("sqlDataSource", sqlDataSource.SaveToXml());
            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
        }
Ejemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Session["RegistrarAsignacion"] = "";
         DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");
         ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);
         if (User.IsInRole("Desarrollo"))
         {
             ASPxDashboard1.WorkingMode = WorkingMode.Viewer;
         }
         // Uncomment this string to allow end users to create new data sources based on predefined connection strings.
         ASPxDashboard1.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider());
         //ASPxDashboard1.OpenDashboard("dashboard1.xml");
     }
     catch (Exception Ex)
     {
         FG.Controlador_Error(Ex, Page.Response);
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            #region #DashboardStorage
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");
            ASPxDashboard1.SetDashboardStorage(dashboardFileStorage);
            #endregion #DashboardStorage

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

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

            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();
            dataSourceStorage.RegisterDataSource("sqlDataSource1", sqlDataSource.SaveToXml());
            dataSourceStorage.RegisterDataSource("olapDataSource1", olapDataSource.SaveToXml());
            ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
            #endregion #DataSourceStorage
        }
Ejemplo n.º 16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ASPxDashboard1.SetDashboardStorage(new CustomDashboardFileStorage(Server.MapPath("~/App_Data/Dashboards/")));
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     ASPxDashboard1.SetDashboardStorage(SessionDashboardStorage.Instance);
     //ASPxDashboard1.SetDashboardStorage(new DashboardFileStorage("~/App_Data/Dashboards")); // Uncomment this line to use the App_Data/Dashboards folder to store dashboards.
 }
Ejemplo n.º 18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ASPxDashboard1.SetDashboardStorage(dashboardStorage);
 }
Ejemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage storage = new DashboardFileStorage("~/App_Data");

            ASPxDashboard1.SetDashboardStorage(storage);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     ASPxDashboard1.SetDashboardStorage(new SessionDashboardStorage(new string[] { "dashboard1" }, string.Format(@"~/App_Data/Dashboards/")));
     //ASPxDashboard1.SetDashboardStorage(new DashboardFileStorage("~/App_Data/Dashboards")); // Uncomment this line to use the App_Data/Dashboards folder to store dashboards.
 }
Ejemplo n.º 21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ASPxDashboard1.AllowExportDashboard = false;
     ASPxDashboard1.SetDashboardStorage(fileStorage);
 }
Ejemplo n.º 22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ASPxDashboard1.AllowExecutingCustomSql = true;
     ASPxDashboard1.SetDashboardStorage(new DashboardFileStorage("~/App_Data/Dashboards"));
 }
Ejemplo n.º 23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ASPxDashboard1.SetDashboardStorage(new DashboardFileStorage("~/App_Data/Dashboards"));
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            CustomFileStorage newDashboardStorage = new CustomFileStorage(@"~/App_Data/Dashboards");

            ASPxDashboard1.SetDashboardStorage(newDashboardStorage);
        }