Passing along new line commands to Report Header

I am modifying a report in Dynamics NAV 2016 with the SQL Report Builder. Its based in the 206 Sales invoice report. In the header it uses an array of length 8 for the address. But if for example the total use of the array is 4 and I want to add a field right after the customer address (its VAT) there will be 4 empty spaces, like this:

Array[1] Info
Array[2] Info
Array[3] Info
Array[4] Info
Array[5] (empty)
Array[6] (empty)
Array[7] (empty)
Array[8] (empty)
VATNoText

I would like to show:
Array[1] Info
Array[2] Info
Array[3] Info
Array[4] Info
VATNoText

So I though I could create a text variable, iterate the array and then add whichever text after (VATNoText in this case). In between each iteration I could add a sort of new line jump command for the report builder. then I could pass this variable through the "=Code.SetData(Cstr....." to a box with can shrink and can grow set as true via Code.GetData(X,1)

I have tried adding the following between each iteration:
' /n '
' + System.Environment.Newline + '
' + vbcrlf + '
' / '
' \n '
' \ ';

It just shows as plain text, and when the string reaches the length of the text box it jumps line.
Example of (sad) output:
Beef House / Frau Karin Fleischer \n
Südermarkt 6 + vbcrlf + 40593
Düsseldorf \ USt-IdNr.: XXXXXXXXXX

The dream:
Beef House
Frau Karin Fleischer
Südermarkt 6
40593 Düsseldorf
USt-IdNr.: XXXXXXXXXX


Any help will be appreciated in my first struggle vs the report builder!
Thank you in advance

Best Answer

  • a_ascanioa_ascanio Member Posts: 2
    Answer ✓
    Solved! Using: https://forum.mibuso.com/discussion/32805/hidden-characters-carriage-return-and-line-feed
    CLEAR(vCustAddrCombined);
    // Defining Carriage return and line feed for the line jumps
    // Source: https://forum.mibuso.com/discussion/32805/hidden-characters-carriage-return-and-line-feed
    vCharCR := 13;
    vCharLF := 10;
    FOR i := 1 TO ARRAYLEN(CustAddr) DO
      IF CustAddr[i] <> '' THEN
        vCustAddrCombined += CustAddr[i] + FORMAT(vCharCR) + FORMAT(vCharLF)
      ELSE
        i := ARRAYLEN(CustAddr);
    vCustAddrCombined += vVATCombined;
    

Answers

  • a_ascanioa_ascanio Member Posts: 2
    Answer ✓
    Solved! Using: https://forum.mibuso.com/discussion/32805/hidden-characters-carriage-return-and-line-feed
    CLEAR(vCustAddrCombined);
    // Defining Carriage return and line feed for the line jumps
    // Source: https://forum.mibuso.com/discussion/32805/hidden-characters-carriage-return-and-line-feed
    vCharCR := 13;
    vCharLF := 10;
    FOR i := 1 TO ARRAYLEN(CustAddr) DO
      IF CustAddr[i] <> '' THEN
        vCustAddrCombined += CustAddr[i] + FORMAT(vCharCR) + FORMAT(vCharLF)
      ELSE
        i := ARRAYLEN(CustAddr);
    vCustAddrCombined += vVATCombined;
    
Sign In or Register to comment.