CrLf Line Feed in text variable in a report

andy76
Member Posts: 616
Hello,
I want to concatenate two variable in the sourceExpression of a TextBox variable multiline in a report.
var1 + ' ' + var2 prints on the same line
but I want something like:
var1 + crlf + var2 where crlf means a line feed/return to print on two lines
without creating 2 different text variables.
Is that possible? How?
Thank you
I want to concatenate two variable in the sourceExpression of a TextBox variable multiline in a report.
var1 + ' ' + var2 prints on the same line
but I want something like:
var1 + crlf + var2 where crlf means a line feed/return to print on two lines
without creating 2 different text variables.
Is that possible? How?
Thank you
0
Comments
-
Is it enough something simple like this?
var1 +'\' + var2
It seems to work correctly...Do you agree?0 -
Create a global Text variable (of 2 length if you want) and set it to the following at the init of the report:
globalTextVar[1] := 13; globalTextVar[2] := 10;
Then use globalTextVar wherever you want CrLf (of course you'd set the variable name to something a bit shorter though.)
But with your example I believe the CrLf or '\' will show up with just blocks.
So I would recommend doing something like...MagicNum Integer padChar Text //Depending on the size of the Textbox you will want to figure out how many 'padChar's you'll need to drop the 2nd portion of text padChar[1] := 255; //Define this somewhere in report init or wherever CLEAR(globVarTextBox); IF STRLEN(Record.Field) < MagicNum THEN globVarTextBox := PADSTR(globVarTextBox,(MagicNum-STRLEN(Record.Field)),padChar); globVarTextBox += Record.Field1 + ' ' + Record.Field2;
The idea is to increase the length of the first "Field1" value enough to force the second value to drop to the next line.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions