Table of Contents

Class CDataDataProvider

Namespace
combit.Reporting.DataProviders
Assembly
combit.ListLabel31.CrossPlatform.dll

Provides a data provider for CData (formerly RSSBus) connectivity drivers.

[Serializable]
public sealed class CDataDataProvider : DbConnectionDataProvider, IDataProvider, ICanHandleUsedIdentifiers, IDisposable, ISupportsLogger, ISerializable
Inheritance
CDataDataProvider
Implements
Inherited Members

Examples

The following example demonstrates how to use the CDataDataProvider to export a report to PDF:

// Example 1: Connecting to Salesforce using CData driver
string salesforceConnectionString = "User=myuser@example.com;Password=mypassword;Security Token=mytoken;";
CDataDataProvider salesforceProvider = new CDataDataProvider(
    salesforceConnectionString,
    CDataDataProvider.CDataProviderInvariantName.Salesforce);

// Create a ListLabel reporting engine instance and assign the provider as the data source.
using ListLabel listLabel = new ListLabel();
listLabel.DataSource = salesforceProvider;

// 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: Connecting to Google Sheets with specific table filtering
string googleSheetsConnectionString = "Spreadsheet=MySpreadsheet;InitiateOAuth=GETANDREFRESH;";

// Specify which tables (sheets) to include
ReadOnlyCollection<string> tablesToInclude = new List<string> { "Sheet1", "Sheet2", "Sales" }.AsReadOnly();

CDataDataProvider googleProvider = new CDataDataProvider(
    googleSheetsConnectionString,
    CDataDataProvider.CDataProviderInvariantName.GoogleSheets,
    tablesToInclude);

// Example 3: Connecting to SharePoint
string sharePointConnectionString = "URL=https://mycompany.sharepoint.com;User=user@mycompany.com;Password=mypassword;";
CDataDataProvider sharePointProvider = new CDataDataProvider(
    sharePointConnectionString,
    CDataDataProvider.CDataProviderInvariantName.SharePoint);

// Example 4: Connecting to QuickBooks
string quickBooksConnectionString = "CompanyFile=C:\\QB\\company.qbw;OpMode=MULTI_USER;";
CDataDataProvider quickBooksProvider = new CDataDataProvider(
    quickBooksConnectionString,
    CDataDataProvider.CDataProviderInvariantName.QuickBooks);

// Example 5: Connecting to OData feed
string oDataConnectionString = "URL=https://services.odata.org/V4/Northwind/Northwind.svc/;";
CDataDataProvider oDataProvider = new CDataDataProvider(
    oDataConnectionString,
    CDataDataProvider.CDataProviderInvariantName.OData);

Remarks

The CDataDataProvider class extends DbConnectionDataProvider to provide connectivity to a wide variety of data sources through CData connectivity drivers (see https://www.cdata.com). CData offers ADO.NET providers for SaaS applications, databases, and web APIs including Salesforce, QuickBooks, SharePoint, Google Sheets, Twitter, OData feeds, and many others. This provider uses the DbProviderFactory pattern to dynamically load the appropriate CData driver assembly based on the specified CDataDataProvider.CDataProviderInvariantName. The provider supports tables and views, with configurable table filtering to limit data access to specific tables. Some CData drivers have limitations (e.g., Google Sheets doesn't support sorting), which are automatically handled by the provider. The class maintains backward compatibility with the older RSSBus driver naming convention.

Constructors

CDataDataProvider(string, CDataProviderInvariantName)

public CDataDataProvider(string connectionString, CDataDataProvider.CDataProviderInvariantName providerInvariantName)

Parameters

connectionString string
providerInvariantName CDataDataProvider.CDataProviderInvariantName

CDataDataProvider(string, CDataProviderInvariantName, ReadOnlyCollection<string>)

public CDataDataProvider(string connectionString, CDataDataProvider.CDataProviderInvariantName providerInvariantName, ReadOnlyCollection<string> tableNames)

Parameters

connectionString string
providerInvariantName CDataDataProvider.CDataProviderInvariantName
tableNames ReadOnlyCollection<string>

Properties

SupportedElementTypes

Gets or sets the supported DbConnectionElementTypes for the database connection.

public DbConnectionElementTypes SupportedElementTypes { get; set; }

Property Value

DbConnectionElementTypes

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 the data provider.

public override bool SupportsAdvancedFiltering { get; set; }

Property Value

bool

TableNames

public ReadOnlyCollection<string> TableNames { get; }

Property Value

ReadOnlyCollection<string>

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

sender object

The source of the event.

e TranslateFilterSyntaxEventArgs

A TranslateFilterSyntaxEventArgs that contains the event data.