Table of Contents

Class SalesforceDataProvider

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

Provides a data provider implementation for Salesforce using SOAP Services.

public sealed class SalesforceDataProvider : IDataProvider, ISupportsLogger, ICanHandleUsedIdentifiers
Inheritance
SalesforceDataProvider
Implements
Inherited Members

Examples

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

// Create a SalesforceDataProvider with your credentials.
// Note: Password must include your security token appended to the end.
SalesforceDataProvider provider = new SalesforceDataProvider(
    "your.email@example.com",
    "yourPasswordYourSecurityToken");

// Optional: Specify specific sObjects to load for better performance.
// string[] specificObjects = new string[] { "Account", "Contact", "Opportunity" };
// SalesforceDataProvider provider = new SalesforceDataProvider(
//     "your.email@example.com",
//     "yourPasswordYourSecurityToken",
//     specificObjects);

// 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);

Remarks

The SalesforceDataProvider class implements IDataProvider, ISupportsLogger, and ICanHandleUsedIdentifiers to provide connectivity to Salesforce databases via SOAP API. It retrieves schema information including sObjects (tables), fields (columns), and relationships from your Salesforce organization. The provider supports advanced filtering with SOQL query syntax, sorting, and can be configured to load only specific sObjects for better performance. Child relationships are automatically discovered and added as relations.

Constructors

SalesforceDataProvider(string, string, string[], string)

Salesforce SOAP API data provider.

public SalesforceDataProvider(string username, string password, string[] sObjects = null, string loginUrl = "https://login.salesforce.com/services/oauth2/token")

Parameters

username string

Username of Salesforce account.

password string

Password of Salesforce account (Salesforce Document: the user must add their security token to the end of their password in order to log in).

sObjects string[]

If you want to not load all Salesforce sObjects, pass a List of names of required sObjects. Default value is null and will load the whole database.

loginUrl string

Salesforce Login Url. Default value is "https://login.salesforce.com/services/oauth2/token".

Properties

ConnectionTimeout

The connection timeout in millisecond to bind to Salesforce web service. Default value is 60000 millisecond (1 minute).

public int ConnectionTimeout { get; set; }

Property Value

int

LoginUrl

Salesforce Login Url. This property is only changable through provider constructor. Default value is "https://login.salesforce.com/services/oauth2/token".

public string LoginUrl { get; }

Property Value

string

UseEmptySchemaRow

If true the SchemaRow property will offer a empty row. Normally SchemaRow has always first row contents.

public bool UseEmptySchemaRow { get; set; }

Property Value

bool