Friday, 6 June 2014

Check mark in Microsoft Dynamics NAV Reports

Recently, one of the partners asked me if it is possible to display Boolean fields as check marks in NAV reports. I tried it out and I must say its pretty simple.

I created a new and simple report on Item table with the following dataset:

Untitled1


In the layout design, I used a table control to display the data in the body section and I used a text box control to show the title of the report in the header:

untitled2

Note: To learn how to use a table control see the video: How to: Build a simple list report in Microsoft Dynamics NAV 2013 

I saved the report and ran it. In the report preview, boolean field values were shown as True/False instead of check mark!

Untitled3

To show the Boolean field as Check mark, I went back to the layout designer and did the following changes:

1. Opened the text box properties for the Boolean field (CostIsAdjusted) and inserted an expression for the value field as shown below:
I changed “=Fields!CostIsAdjusted_Item.Value to =IIF(Fields!CostIsAdjusted_Item.Value,Chr(254),Chr(168))

Untitled4

2. Changed the font to Wingdings for the Boolean field only:

Untitled5

After these 2 changes, I saved the report and ran it. The preview now displays check marks for Boolean field values:

Untitled6


Regards,
Sathish

No comments:

Post a Comment