NAV 2013 R2 Report Trick – Split Concatenated String on New Line

Presentation of data is really important for reports since it is an effective way to show users key data they will be interested in.

In this demonstration, we will go over a quick NAV 2013 R2 report trick that will display information in a user-friendly manner. If you are going to have a string that will be concatenated, you have the ability to show each value that will be added to the string on new lines by adding a special character in your string. We will be able to replace the special character in Visual Studio by the new line function.

  1. Define a text variable
    1. Navigate to the report global variables by going to View > C/AL Globals
    2. BinRecord will be a text variable that will hold multiple values for the Bin Code field





  2. Add a special character
    1. In this code, Bin Code is added to the BinRecord until the BinCount value is less than 5
    2. Each time Bin Code is added to the BinRecord variable, a “|” will be inserted in between. This allows us to replace the “|” with the new line function.
  3. Modify the report
    1. Navigate to the report layout by going to View > Layout
    2. Add the BinRecord variable to a textbox in the report layout
    3. Modify the code to replace the “|” with the new line function “VBCRLF”
      1. Before code change:
      2. After code change:
    4. This code change will replace “|” after each Bin Code value with a new line
  4. Report output
    1. Report preview before code change:
    2. Report preview after code change:

The appearance of the data after the code change presents the data in a way that will be easy to read and understand. Identifying ways to improve the report layout will help users understand the information that will be portrayed to them and make the report look meaningful.

July 22, 2015


Email [email protected] with any questions you have pertaining to this course.

New CPE Accredited Courses Now Available for Dynamics AX, GP, and NAVEARN CREDITS TODAY