Passing along new line commands

meobeoumeobeou Posts: 1Member
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

Lee!

Answers

  • vaprogvaprog Posts: 880Member
    Hi Lee

    use the replace function in the value property of your textbox to replace your placeholder you send from NAV with vbNewline. That is, fill in the final newline in the layout, not the NAV dataset.
  • JuhlJuhl Posts: 661Member
    add the value to Addr[8] if empty, after addressfunction, and then do a compressarray. If all 8 er sometimes used, maybe change the variable to 9.
    Follow me on my blog juhl.blog
Sign In or Register to comment.