Skip to main content

Register a Custom Schema Provider for a Synonym Database

  • 4 minutes to read

This document describes how to implement a custom data source schema provider that enables end-users to bind reports to a synonym database.


A synonym is a database object that provides an alternative name for another database object.

Refer to the Oracle and Microsoft SQL Server documentation to learn how different database engines support synonyms.

Implement a Custom Schema Provider

The following code shows how to create a custom database schema provider inherited from the DBSchemaProviderEx class that is the IDBSchemaProviderEx interface’s default implementation.

using DevExpress.DataAccess.Sql;
using DevExpress.Xpo.DB;
using System.Collections.Generic;
using System.Linq;
// ...

public class SynonymDBSchemaProvider : DevExpress.DataAccess.Sql.DBSchemaProviderEx {
    public override DBTable[] GetTables(SqlDataConnection connection, params string[] tableList) {
        List<DBTable> tables = base.GetTables(connection, tableList).ToList();
        if(connection.Name == "OracleConnection")
            tables.Add(new DBTable("Regions") {
                Columns = {
                    new DBColumn { Name = "REGION_ID", ColumnType = DBColumnType.Int32 },
                    new DBColumn { Name = "REGION_NAME", ColumnType = DBColumnType.String, Size = 25 },

        return tables.ToArray();

Register the Schema Provider in a WinForms Reporting Application

The following code registers a custom database schema provider in a WinForms End-User Report Designer by calling the XRDesignMdiController.AddService method.

using DevExpress.DataAccess.Sql;
using DevExpress.XtraReports.UserDesigner;
// ...

public partial class Form1 : XRDesignRibbonForm {
    public Form1() {
        DesignMdiController.AddService(typeof(IDBSchemaProviderEx), new SynonymDBSchemaProvider());

Register the Schema Provider in a WPF Reporting Application

The following code registers a custom database schema provider in a WPF End-User Report Designer.

<Window x:Class="CustomDBSchemaProviderEx.MainWindow"
        Title="MainWindow" >

    <dxrud:ReportDesigner HorizontalAlignment="Left" VerticalAlignment="Top">
            <dxda:InstanceEntry ServiceType="{x:Type dasql:IDBSchemaProviderEx}" >
                    <local:SynonymDBSchemaProvider />


Register the Schema Provider in an ASP.NET Reporting Application

Create a custom database schema provider factory by implementing the IDataSourceWizardDBSchemaProviderExFactory interface as shown below. Use the IDataSourceWizardDBSchemaProviderExFactory.Create method to initialize a new custom data store schema provider (SynonymDBSchemaProvider).

using DevExpress.DataAccess.Sql;
using DevExpress.DataAccess.Web;
// ...

public class MyDataSourceWizardDBSchemaProviderFactory : IDataSourceWizardDBSchemaProviderExFactory {
    public IDBSchemaProviderEx Create() {
        return new SynonymDBSchemaProvider();

ASP.NET Application

Register the custom database schema provider factory by calling the static DefaultReportDesignerContainer.RegisterDataSourceWizardDBSchemaProviderExFactory<T> method, as shown below.

using DevExpress.DataAccess.Web;
using System;
// Add a reference to the DevExpress.XtraReports.Web assembly
using DevExpress.XtraReports.Web.ReportDesigner
// ...

public class Global_asax : System.Web.HttpApplication {
    void Application_Start(object sender, EventArgs e) {
        // ...
        // Register the custom provider factory.
    // ...

ASP.NET Core Application

Register the custom database schema provider factory by calling the RegisterDataSourceWizardDBSchemaProviderExFactory<T>() method, as shown below.

using DevExpress.AspNetCore;
using DevExpress.AspNetCore.Reporting;

public class Startup {
    public void ConfigureServices(IServiceCollection services) {

        services.ConfigureReportingServices(configurator => {
            configurator.ConfigureQueryBuilder(queryBuilderConfigurator => {