Class OracleConnectionDataProvider
- Namespace
- combit.Reporting.DataProviders
- Assembly
- combit.ListLabel31.CrossPlatform.dll
Provides a data provider implementation for Oracle databases using ADO.NET.
[Serializable]
public sealed class OracleConnectionDataProvider : DbConnectionDataProvider, IDataProvider, ICanHandleUsedIdentifiers, IDisposable, ISupportsLogger, ISerializable
- Inheritance
-
OracleConnectionDataProvider
- Implements
- Inherited Members
Examples
The following example demonstrates how to use the OracleConnectionDataProvider to export a report to PDF:
// Example 1: Basic connection with connection string
OracleConnectionDataProvider provider = new OracleConnectionDataProvider(
"User Id=myuser;Password=mypassword;Data Source=myoracle:1521/ORCL");
// Create a ListLabel reporting engine instance and assign the provider as the data source.
using ListLabel listLabel = new ListLabel();
listLabel.DataSource = provider;
// Configure export settings to generate a PDF.
ExportConfiguration exportConfiguration = new ExportConfiguration(LlExportTarget.Pdf, exportFilePath, projectFilePath);
exportConfiguration.ShowResult = true;
// Export the report to PDF.
listLabel.Export(exportConfiguration);
// Example 2: Connection with specific schema (owner) filtering
OracleConnectionDataProvider schemaProvider = new OracleConnectionDataProvider(
"User Id=myuser;Password=mypassword;Data Source=myoracle:1521/ORCL",
"MYSCHEMA");
// Example 3: Connection with multiple schemas
List<string> schemas = new List<string> { "SCHEMA1", "SCHEMA2", "HR" };
OracleConnectionDataProvider multiSchemaProvider = new OracleConnectionDataProvider(
"User Id=myuser;Password=mypassword;Data Source=myoracle:1521/ORCL",
schemas.AsReadOnly());
// Example 4: Configure table name prefixing with owner
OracleConnectionDataProvider prefixedProvider = new OracleConnectionDataProvider(
"User Id=myuser;Password=mypassword;Data Source=myoracle:1521/ORCL");
prefixedProvider.PrefixTableNameWithOwner = true;
// Example 5: Filter to only tables (exclude views)
OracleConnectionDataProvider tablesOnlyProvider = new OracleConnectionDataProvider(
"User Id=myuser;Password=mypassword;Data Source=myoracle:1521/ORCL");
tablesOnlyProvider.SupportedElementTypes = DbConnectionElementTypes.Table;
// Example 6: Skip relationship analysis for faster initialization
OracleConnectionDataProvider fastProvider = new OracleConnectionDataProvider(
"User Id=myuser;Password=mypassword;Data Source=myoracle:1521/ORCL");
fastProvider.DisableRelations = true; // Useful for Report Server datasource configuration
Remarks
The OracleConnectionDataProvider class extends DbConnectionDataProvider to provide connectivity
to Oracle Database, one of the world's most widely-used enterprise database systems. It supports Oracle Data Provider for .NET
(ODP.NET) using either the managed provider (Oracle.ManagedDataAccess.Client) as the preferred option, or the unmanaged
provider (Oracle.DataAccess.Client) as a fallback. The provider automatically discovers tables and views, retrieves
foreign key relationships from Oracle's system catalog (ALL_CONSTRAINTS, ALL_CONS_COLUMNS), and handles composite primary keys.
Schema filtering allows limiting data access to specific database schemas (owners), excluding Oracle system schemas by default.
The provider includes special handling for Oracle NUMBER fields that exceed System.Decimal precision, using reflection to access
Oracle-specific types. It supports custom filter syntax translation for List & Label expressions, converting them to
Oracle-compatible SQL syntax. Table name prefixing with owner names is configurable. The combit.Reporting.DataProviders.OracleConnectionDataProvider.DisableRelations property
can be used to skip relationship analysis for improved initialization performance when only table lists are needed.
Constructors
OracleConnectionDataProvider(string)
Initializes a new instance of the OracleConnectionDataProvider class with the specified connection string. No table owner is specified.
public OracleConnectionDataProvider(string connectionString)
Parameters
connectionStringstringThe connection string used to connect to the Oracle database.
OracleConnectionDataProvider(string, ReadOnlyCollection<string>)
Initializes a new instance of the OracleConnectionDataProvider class with the specified connection string and a collection of table owners.
public OracleConnectionDataProvider(string connectionString, ReadOnlyCollection<string> tableOwners)
Parameters
connectionStringstringThe connection string used to connect to the Oracle database.
tableOwnersReadOnlyCollection<string>A read-only collection of table owner names. These names will be used to prefix table names when accessing the database.
OracleConnectionDataProvider(string, string)
Initializes a new instance of the OracleConnectionDataProvider class with the specified connection string and table owner.
public OracleConnectionDataProvider(string connectionString, string tableOwner)
Parameters
connectionStringstringThe connection string used to connect to the Oracle database.
tableOwnerstringThe name of the table owner to prefix table names with. If not provided, no owner is used.
Properties
PrefixTableNameWithOwner
Gets or sets a value indicating whether the table name should be prefixed with the owner's name.
public bool PrefixTableNameWithOwner { get; set; }
Property Value
SupportedElementTypes
Gets or sets the supported DbConnectionElementTypes for the database connection.
public DbConnectionElementTypes SupportedElementTypes { get; set; }
Property Value
Remarks
This property indicates which element types (tables, views) are supported by this data provider.
SupportsAdvancedFiltering
Gets or sets a value indicating whether advanced filtering is supported by this data provider.
public override bool SupportsAdvancedFiltering { get; set; }
Property Value
Methods
Init()
When implemented in a derived class, initializes the data provider.
protected override void Init()
OnTranslateFilterSyntax(object, TranslateFilterSyntaxEventArgs)
Raises the TranslateFilterSyntax event.
protected override void OnTranslateFilterSyntax(object sender, TranslateFilterSyntaxEventArgs e)
Parameters
senderobjectThe source of the event.
eTranslateFilterSyntaxEventArgsA TranslateFilterSyntaxEventArgs that contains the event data.