A list data-region can be used to create a free-form layout report. Like a table and a matrix, a list data-region is not restricted to a grid layout. It acts as a container for the placement of multiple report items side by side so that you can easily design business reports such as an invoice, a mail-merge, and a form.
In this blog post, we are going to create a list report to display employee details in a mail-merge format. First, launch the Bold Reports On-Premise server demo site, refer to the steps to create a report, and create a new report.
Create data set
To feed data to the list data-region, I used the Employees details from the sample JSON data and transformed that JSON data into rows and columns using a SQL query.
- In the data panel, click New Data.
- Choose the SQL connection type.
- As mentioned earlier, we are going to create a data set by transforming JSON data. So, you can provide credentials and connect with any of your server databases.
- In the query builder, switch to query mode. Refer to Microsoft’s documentation to write the SQL query to transform the JSON data into rows and columns.
- Now, click Finish.
Refer to the query builder overview blog post and data set creation documentation, and create the data set in a report. You can download the report that contains the previous data set from https://boldreports.com/wp-content/uploads/2020/05/Employee-Records.zip
Add a list to the report
The list report item is displayed in the item panel under Data Regions.
Drag the list report item to the design area from the item panel.
Once you drop the list item, it renders as a row and a column in the design surface. Its properties are listed in the properties panel.
Assign a data set
To assign a data set, select the list report item and set the data set name to the Dataset property in the properties panel.
Displaying records in the list
Let’s display employee details in the list surface using images, rectangles, and text boxes. You can drag and drop the report item or right-click inside the list surface to use a menu to insert the items.
First, add two rectangle report items inside the list to display employee images and personal details side by side. Resize the list report item width and height to the required size.
Then, drag and drop an image item in the left rectangle to display the employee image in the report.
To display the employee image from the database in an image report item, bind the Photo field from the database to an image item. Refer to the image report item documentation to understand the steps involved in assigning data to an image report item.
Now, let’s place other information from the data set—like employee name, birth date, address, etc.—onto the list surface.
Insert a text box into the right side rectangle and enter “Name.” Resize the text box to the dimensions you want.
Drag the FullName field from the data set into the list surface.
Similarly, add the data fields (Title, Birth Date, Notes, Country, City, Address, and HomePhone) and labels for each data field using text boxes in the list data-region surface.
To display employee addresses, I clubbed the Country, City, and Address fields in a single text box using the expression builder. Refer to the Bold Reports documentation article “Display dynamic text using expression” to display multiple data fields in a text box.
Formatting list appearance
Add formatting to improve the look and feel of the report. First, let’s apply formatting to the labels.
On the list surface, select the text boxes that display label text and open the properties panel.
- Under Basic Settings, change font family to Segoe UI, font color to White, font size to 11, and font style to Bold.
- Under Alignment, change the Text Alignment to Left and Vertical Alignment to Middle.
- Under Appearance, change the Background Color to #6d8c59.
Similarly, apply formatting for text boxes that display data fields.
Select the list cell and set Border as None.
Refer to the list data-region documentation to learn more about list data-region properties.
Adding report headers
Add a header and remove the footer from the report design by referring to the documentation article “Show or Hide Header and Footer.”
Insert a rectangle and a text box within the header area. Adjust the width and height as required.
Set the report title in the text box and customize its appearance by using the text box and rectangle properties in the properties panel.
You can preview the report using the built-in Report Viewer. The list data-region displays employee records in a mail merge format.
I hope this blog provided a basic knowledge about list data region and how to create a report using it in Bold Reports Designer. To explore further, go through our sample reports and Bold Reports documentation. I have also attached the generated .rdl file for further reference.
If you have any questions, please post them in the comments section. You can also contact us through our contact page or, if you already have an account, you can log in to submit your support question.
Bold Reports now comes with a 15-day free trial with no credit card information required. We welcome you to start a free trial and experience Bold Reports for yourself. Give it a try and let us know what you think!