FlexReport for WinForms | ComponentOne
Data Binding / ADO.NET DataConnector Integration
In This Topic
    ADO.NET DataConnector Integration
    In This Topic

    FlexReportDesigner lets you bind report from online data sources to data using ADO.NET DataConnectors. This allows you to easily and quickly design and create reports from Salesforce, OData, Dynamics 365 Sales, Google Analytics, Json, Kintone, ServiceNow and QuickBooks Online using the FlexReport designer. It is made possible using the ComponentOne DataConnectors library, which is available separately for developers to access and generate their reports entirely programmatically as well. 

    Let us explore how to use DataConnectors to generate a data connection and generate report in FlexDesigner App.

    The following steps demonstrate how you can connect to Salesforce and create a report from Salesforce data using FlexReport designer.

    1. Launch the C1FlexReportDesigner.4.5.2.exe for 64-bit platform and C1FlexReportDesigner32.4.5.2.exe for 32-bit platform located at the following location on your computer:
      C:\Program Files (x86)\ComponentOne\Apps\v4.5.2
    2. From the Reports tab on the left, click New Report dropdown button. This opens the FlexReport Wizard which walks us through the basic report setup.
    3. Select the ADO.NET.Salesforce data provider, C1.AdoNet.Salesforce, from the Data provider drop-down.
    4. Enter your connection string.
      To build your connection string, you need to have a Salesforce account. You can get the client ID and OAuth endpoint from the Salesforce website by registering your application and generating the security token.
    5. Select tables and fields you want to display in the report or enter SQL statement to select the tables and fields and click Next.
      In this example, we used SQL statement as shown in the image below:
    6. Click through the wizard selecting other settings for the report such as style, layout template and title of the report. Then, click Finish.
      This generates the report. The report generated in this example is shown below.

    You can continue editing the report template by resizing or rearranging fields. The FlexReport designer supports snap lines, which allows you to easily align report fields. If you want to add a new field from the Salesforce data set, select Insert - Text - and select the field name. Then, drag where in the report you want the field to display.

    Similar to Salesforce, you can connect to OData, Dynamics 365 Sales, Google Analytics, Json, Kintone, ServiceNow and QuickBooks Online, and create reports using the data accessed from these data providers. You just need to select the respective data provider and provide the connection string. The connection strings for all these data providers are given in the following table:

    Provider Name Connection String
    Security Token=yourToken;
    OAuth Client Id=*******;
    OAuth Client Secret=*****;
    OAuth Token Endpoint=yourToken;
    Use Pool = false; Max Page Size = 200
    OAuth Client Id=***********;
    OAuth Client Secret=********;
    OAuth Token Endpoint=https://***/***/***;
    OAuth Extend Properties=yourExtendProperties;
    Use Etag=true;Max Page Size = 100
    Company Id=yourID;Use SandBox=true;
    OAuth Client Secret=********;
    OAuth Client Id=********;
    OAuth Access Token=yourToken;
    OAuth Refresh Token=********;
    OAuth Token Endpoint=https://***/***/***;
    Minor Version=52
    Key File=yourWijmoFile.json;
    View Id=*******"
    data model=yourDataModel;
    uri= yourJsonFile;
    json path=$.tableName
    Username= yourusername;
    Password= yourpassword;
    Oauth Client Id= yourid;
    Oauth Client Secret= yoursecretcode; 
    Oauth Token Endpoint= http://****/****/****; 
    Url= http://****/****/****      
    Uri= yourCSVFile;

    You can download the data connector libraries from https://developer.mescius.com/componentone/download. Note that the FlexReportDesigner app with built-in DataConnector is available with ComponentOne Studio Enterprise only.

    Also, note that in order to use DataConnectors with FlexReport in Visual Studio, you need to add the data connector package in your Visual Studio project to integrate it with the report control.

    Note: FlexReport does not support hierarchical data so nested JSON object’s properties cannot be accessed directly in FlexReport.