protected void Page_Load(object sender, EventArgs e) { ASPxDashboard1.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider()); ASPxDashboard1.AllowExecutingCustomSql = true; ASPxDashboard1.EnableCustomSql = true; ASPxDashboard1.WorkingMode = WorkingMode.Viewer; }
protected void Page_Load(object sender, EventArgs e) { // Button BackButton = (Button)Master.FindControl("back"); // BackButton.Enabled = false; // BackButton.Visible = false; ASPxDashboard1.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider()); string uname = HttpContext.Current.User.Identity.Name; conn = new SqlConnection("server=10.100.100.25\\SPLAHOST;Database=graphs;Integrated Security=false;User ID=petpakn;Password=net123321!;"); conn.Open(); // Create SqlCommand to select pwd field from users table given supplied userName. cmd = new SqlCommand($"select userRole from Users where uname='{uname}'", conn); /// Intepolation or the F string. C# > 5.0 // Execute command and fetch pwd field into lookupPassword string. var sdr = cmd.ExecuteScalar(); var user = sdr.ToString(); if (user == "SuperAdmin") { ASPxDashboard1.WorkingMode = WorkingMode.Designer; } else { ASPxDashboard1.WorkingMode = WorkingMode.Viewer; } }
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); }
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) { ASPxDashboard1.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider()); }