How you can generate customized Sitecore reports – Part 3
Home

How you can generate customized Sitecore reports – Part 3

Author: Anurag Agarwal | Categories: CMS, Sitecore CMS

C# coding for business report:

In this example, we'll create a new customer report to report on fictitious customers.

1) Create a new C# Class Library called CustomerLibrary and generate some sample data to be featured in the report. This can look like something shown below. Ensure the name of the assembly is same as the name of the namespace, in this case, CustomerLibrary.

customer library

However, you can choose a different data source for reporting. Here is an example of how you can connect MongoDB using the C# business object.

customer library 1

Open the Sitecore Content Editor, go to start menu and click on the new link Business Object Report Designer. Type in Customer Report in the top text box field and click Create and Design as illustrated below.

customer library 2

The Stimulsoft Report Designer should now open. In the right-hand side, click on the Dictionary tab, click the icon as shown below and select New Data Source.

customer library 3

A popup box is shown, where you should select Data from Business Objects and Fill in the values in the "New Data Source" dialogue. This will create a data source that expects data to be in a certain format for the report.

Data Source

Now you'll need to create a report that pulls data from the data source you just created. Click the icon shown in the screenshot below, select New, then New Report with Wizard. Using report wizard select the data source and click the checked box of the column.

customer library 5

Save the report and run.

customer library 6