We added a .NET Standard service library, DataConnectors, to connect to online data sources like Microsoft Dynamics 365, OData, Salesforce, Google Analytics, and Kintone using an ADO. NET provider for each type. This library can be used to bind any data-aware control with the aforementioned data sources.
We recently published a blog post, “How to Bind FlexReport to Salesforce CRM Data,” which shows how to use the DataConnectors library to bind FlexReport to Salesforce data at runtime. At that time, working the same at design time via FlexReportDesigner was not supported.
With the 2021 v1 release of ComponentOne, we added a new feature to bind reports to data from online data sources like Salesforce, OData, Dynamics 365 Sales, Google Analytics, Kintone, and QuickBooks using ADO.NET DataConnectors with FlexReportDesigner.
This blog will illustrate how to bind a FlexReport to the Opportunity data table of Salesforce using FlexReport Designer converted into Opportunities from the available Leads. The complete steps from creating the connection string to rendering the report are as follows:
Before connecting to Salesforce, we need to create an app and connect using the app's credentials. This Salesforce resource explains how to configure your application so that OAuth can authenticate your application:
The following information is required to connect to Salesforce:
Most of the above credentials will be available on the application page in Salesforce, and a security token would have been sent to the registered email used for creating the Salesforce account. The image below displays the OAuth Client Id (Consumer Key) and OAuth Client Secret (Consumer Secret).
Now we have the required information for building the connection string to connect to Salesforce. The final connection string will be in the below-given format as per the documentation.
Username= username ;Password= password; Security Token=your Token that you got on mail ; OAuth Client Id= consumer Key; OAuth Client Secret= consumer Secret; OAuth Token Endpoint=https://ap16.salesforce.com/services/data/v45.0; Url=https://ap16.salesforce.com/services/data/v45.0; Use Pool = false; Max Page Size = 200
Please follow the steps to create a report via FlexReportDesinger and connect with the Salesforce using the connection string that we build in step 1:
C:\Program Files (x86)\ComponentOne\Apps\v4.5.2
Here we have selected the Opportunity table from the list of default tables.
By following the above-given steps, you can create a sales opportunity report from the Salesforce data source coming from the different lead sources.
Whenever creating a business report, everyone has their own designs to make the report more interactive and using FlexReportDesigner. You are free to design the report as per your need. Please see the documentation to learn how you can modify the report by changing the fields' font, alignment, position, etc.
Here we have presented the data in the grouped format with modified font, alignment, and position of some fields to make the report look nice. Next, we added a FlexChart field in the Group Header section that shows the count of different Stage Names under the particular Lead Source group by setting the following properties:
To learn more about applying grouping to the chart, you can go through the documentation here.
After completing all the modifications, the report looks like below:
Similarly, you can connect to other data sources by creating the connection string suggested in the documentation.
Try it yourself! Ask questions in the comments section below. Happy coding!