Table of Contents

Class NpgsqlConnectionDataProvider

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

Provider for Npgsql Postgres connection, see http://npgsql.projects.postgresql.org/

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

Examples

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

// Initialize the NpgsqlConnectionDataProvider with your connection string.
NpgsqlConnectionDataProvider provider = new NpgsqlConnectionDataProvider("your connection string here");

// Create an instance of the List & Label reporting engine and assign the provider as its data source.
using ListLabel listLabel = new ListLabel();
listLabel.DataSource = provider;

// Configure export settings to generate a PDF.
ExportConfiguration exportConfiguration = new ExportConfiguration(LlExportTarget.Pdf, @"C:\Exports\report.pdf", @"C:\Projects\report.llproj");
exportConfiguration.ShowResult = true;

// Export the report to PDF.
listLabel.Export(exportConfiguration);

Remarks

The NpgsqlConnectionDataProvider class extends DbConnectionDataProvider to provide connectivity to PostgreSQL databases via the Npgsql .NET data provider. It supports tables and views, advanced filtering, and schema-aware query construction using customizable identifier delimiter and parameter marker formats. This provider is serializable and can be used as a data source for reporting engines such as List & Label.

Constructors

NpgsqlConnectionDataProvider(IDbConnection)

Initializes a new instance of the NpgsqlConnectionDataProvider class using the specified MySQL connection.

public NpgsqlConnectionDataProvider(IDbConnection connection)

Parameters

connection IDbConnection

An open Npgsql connection.

Properties

PrefixTableNameWithSchema

Gets or sets a value indicating whether table names should be prefixed with the schema.

public bool PrefixTableNameWithSchema { get; set; }

Property Value

bool

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 this provider.

public override bool SupportsAdvancedFiltering { get; set; }

Property Value

bool

Methods

GetNativeAggregateFunctionName(NativeAggregateFunction)

Gets the native aggregate function name for the specified aggregate function.

protected override string GetNativeAggregateFunctionName(NativeAggregateFunction function)

Parameters

function NativeAggregateFunction

The aggregate function to be mapped.

Returns

string

The native aggregate function name as used by FirebirdSQL, or null for unsupported functions.

Init()

Initializes the data provider by retrieving schema information from the PostgreSQL database.

protected override void Init()

Remarks

The method retrieves tables and views using the GetSchema method of the connection, merges them if necessary, and builds commands to retrieve all data from each table. It also retrieves relation information from the information_schema and adds relations accordingly.

OnTranslateFilterSyntax(object, TranslateFilterSyntaxEventArgs)

Translates filter syntax from List & Label expressions to FirebirdSQL-specific syntax.

protected override void OnTranslateFilterSyntax(object sender, TranslateFilterSyntaxEventArgs e)

Parameters

sender object

The source of the filter translation request.

e TranslateFilterSyntaxEventArgs

A TranslateFilterSyntaxEventArgs object that contains the event data.