devexpressdashboarddevexpress-mvc

Limit tables shown in DevExpress Dashboard - Query Builder


Im trying to limit the tables shown in the DevExpress Dashboard Query Builder. I tried adding Queries like below but the Query Builder still show all tables in the database.

Is there a way to limit the tables shown in the Query Builder?

DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();
DashboardSqlDataSource sqlDataSource = new DashboardSqlDataSource("MyApp", customstringParams);


SelectQuery selectQuery = SelectQueryFluentBuilder
            .AddTable("EMPLOYEE_DETAIL", "Employee Master")
            .SelectAllColumns()
            .Build("Employee Information");

sqlDataSource.Queries.Add(selectQuery);

SelectQuery selectQuery2 = SelectQueryFluentBuilder
            .AddTable("EMPLOYEE_ATTENDANCE", "Shift Distribution")
            .SelectAllColumns()
            .Build("Shift Distribution");
        sqlDataSource.Queries.Add(selectQuery2);


sqlDataSource.Fill();
dataSourceStorage.RegisterDataSource("sqlDataSource", sqlDataSource.SaveToXml());

        DashboardConfigurator.Default.SetDataSourceStorage(dataSourceStorage);

Solution

  • To accomplish this task, use the approach described in Query Builder - Limit the list of available Stored Procedures, Tables, or Views.