RDLC Report Designer Tutorial and Basic Setup [using RDLC Report Builder] for Business Central

In this rdlc report designer tutorial, I will discuss the basic setup for the rdlc report in Report Builder. Microsoft Report Builder is a tool to build paginated reports used by the Microsoft reporting system. RDLC Stands for Report Definition Language Client-Side. The .rdlc is the format of a report file used by the Microsoft reporting system.

Report Builder


Let's start this tutorial with Basic Setup.

Report properties setup:

When you open the report designer right-click on blank space and select report properties.

Report Properties page setup


First of all, let's see Page Setup properties:
  1. Page Units: Inches
  2. Paper Orientation: Portrait (As per required, but start with portrait if not sure)
  3. Paper Size: Letter
  4. Margins: 
    1. Left: 0.5 in
    2. Right: 0.5 in
    3. Top: 0.5 in
    4. Bottom: 0.5 in
Other report properties like Code, References, and variables are not needed to change for the basic setup. If you need to use get and set data we need to write code on the Code properties section. 

Report Body Setup:

Click on the report body and see the properties window on the right side of the screen. If the properties window is not shown then go to the view tab and checkmark Properties.

In properties window set the size of report page:
  1. Size Setup:
    1. Width: 7.4 in
    2. Height: 2 in (could increase/decrease as needed)
Note: we set the width as 7.4 in because we subtract 0.5 * 2 (page margins from page setup) from 8.5 and just keep 0.1 inches as precision/safety. You can keep 7.5 in but sometimes the last column of the table might print on the next page during the report preview. So to avoid this try to fit the report in 7.4 inches.
 
If you need to change the background color of the page or border style of body section then you can change the setting in the properties section.

Font setup:

To activate font setup you need to select a text box or any report item. By default Font is Arial and size is 10. But for a better view of the report I always setup my font as following:
  1. Font Family: Segoe UI
  2. Font size: 8 pt (10 pt - For Title)
  3. font color: Black
  4. Font Style: Normal
  5. Font weight: Default (Bold - For Title)
  6. Text Decoration: Default
  7. Text Align: Right
For font setup I suggest changing the font after creating most of the report items like text box and tables. Also for tables select individual cells or select all cells, but selecting the table doesn't work for font properties. During the finalization of the report please make sure all fonts meet the standard of the report.

Text Box Setting:

Just setting up font is not sufficient for displaying reports elegantly, we need to setup textbox and table too. The following are some of them for Textbox.
  1. Padding: 2 pt, 2 pt, 2 pt, 2 pt 
  2. CanGrow: False
  3. CanShrink: False 
  4. Border Style: None
  5. Size:
    1. width: 1 in
    2. Height: 0.5 cm (Height in centimetre)

Table Setting:

Table is one of the most use report item in the rdlc report. I usually do following setup when working in tables:
  1. First I will setup the data source and name of the table. To do so:
    1. First, go to tablix properties by right-clicking the table top-left box.
    2. In general tab, go to the dataset name and select the dataset. Generally, the name of the dataset is 'Dataset_Result'
    3. To change name of table from Tablix1, just go to name section in general tab. In box of name section write name of table without space and CamelCase.
  2. After this I change the font from Arial to Segoe UI 8 pt. Do this by selecting all cells individually.
  3. After font is setup we need to fix the size of row.
    1. Width: 1 in
    2. Height: 0.5 cm (0.19685 in)
  4. Also make growing and shrinking property false so even the field is long or short table design remains constant.
    1. CanGrow: False
    2. CanShrink: False
  5. Remove border from header and body of table. To do so select all cell of table and change the border property.
    1. BorderStyle: None
    2. BorderColor: Black (Delete the color it will take it to default)
    3. BorderWidth: 1 pt
  6. On the header I always prefer to keep border at bottom section. So for that select all the cell of only header of table and change the border style.
    1. BorderStyle: Solid
    2. BorderColor: Black (Delete the color it will take it to default)
    3. BorderWidth: 1 pt

Advance Table setup :

  1. To repeat table header on each page.
  2. Add grouping

Adding Built-in fields in the report:

In beginning days of report development, we used to get page number, date, and user from a dataset but now these fields are available as a built-in variable in the report itself.

We will be adding these built-in fields in the header section of the report. Let's add a header to the report by right-clicking outside of the report body and selecting Report Header.

Execution Date and Time: 

We use a built-in field called ExecutionTime to get execution date and time of the report. This global variable gives the date and time that the report begins to run. 
=Globals!ExecutionTime
If you want to just display date only or time only then you need to format the field.

Execution date and time of report in rdlc

Page Number: 

We use a built-in field called PageNumber for the current page number and to see total page number we use TotalPages.

The current page number, which can be reset through the use of page breaks. Can be used only in page header or footer.
=Globals!PageNumber 

The total number of pages in the current continuous page sequence. The number can be reset by using page breaks. Can be used only in a page header and footer.

=Globals!TotalPages

For more setup of page number, I will write it in another blog post.

User ID: 

We use a built-in field called USERID to get the ID of the user running the report.
=User!UserID

Conclusion:

I will be updating this post as I find some more tips on the report but for basic this setup is enough. If you have any other setup in a report please let me know in a comment below, I will update the setup in this blog.

Resources:

To download the latest version of Microsoft Report Builder click here.
To know rdlc report basic setup in visual studio click here.
For the report-builder tutorial click here.

Post a Comment

Thank you for comment, I really appreciate your view.

–>