With the release of Dynamics NAV 2013, developers now have the flexibility to design RDLC reports with the use of Visual Studio.
It is important that we design professional and consistent reports that allow users to be able to easily scan and read information. In this blog, we will be discussing how to repeat a header on each new page and display Boolean fields as checkboxes in our reports.
Repeat Header on New Page
When you are building a report with a tablix data region, the header that is inserted into the table does not natively repeat on every page.
If you check the Tablix Properties, there is an option under the General tab in the Row Headers section called “Repeat header rows on each page”.
However, checking this option does not seem to cause the header to repeat on every page as expected.
In order to get the header to repeat on every page, you will need to follow these steps:
- Click on the tablix that you are trying to update.
- In the grouping pane, click on the small triangle in the top right corner and select “Advanced Mode”. Switching to Advanced mode allows for you to select different static and dynamic tablix members and set individual properties on each level.
- Each static item displayed in the Row Groups represents a row header. Select the static row that you would like to repeat on each page.
- In the properties pane, set KeepWithGroup to “After” if the static row you would like to display is above a group or set KeepWithGroup to “Before” for a static row to display below a group.
- Set RepeatOnNewPage to “True”.
- Repeat Step 4 and 5 for any additional static rows that you need to repeat on a new page.
Display Boolean Field as Checkmark
We will now learn how to display a Boolean field as a checkmark.
- We will first need to create a report and add our Boolean field to the dataset.
2. We can then create a table or tablix control to display the information from our dataset. Make sure to add the Boolean field to the table control. Once you save, compile, and run the report, you will notice that natively the Boolean field displays as True/False.
3. Open the Layout designer again, and open the Textbox properties of the Boolean field you would like to display as a checkmark. In the General Tab under Value, click the fx button to open the source expression page
4. Update the source expression to the following and replace “Field Name” with the name of the Boolean field =IIF(“Field Name”,Chr(254),Chr(168))
5. You will then need to change the font of the individual textbox to Wingdings.
6. Now if you save the report and run it again, you will notice that the Boolean field is displayed as a checkbox instead of True/False.
You have now succeeded in creating more professional reports that your users can easily scan to obtain the information they need.