Format a text line witch CR/LF
Roger
Member Posts: 57
I've got a dataport in order to export contact information. One of the export fields are a text field witch a length of 250
I put the complete contact information in this field, formatted by the FormatAddr.ContactAddr - Funktion.
No, I want to separate each element (name, address, city and so on) by a new line in order to put this field in a word mergefile as an addressblock. The address should be there in the right form.
I'm not able to use Interaction templates.
Is anybody here who can help me?
Many thanks
Roger
I put the complete contact information in this field, formatted by the FormatAddr.ContactAddr - Funktion.
No, I want to separate each element (name, address, city and so on) by a new line in order to put this field in a word mergefile as an addressblock. The address should be there in the right form.
I'm not able to use Interaction templates.
Is anybody here who can help me?
Many thanks
Roger
Many thanks, Roger
0
Comments
-
You can also use a codeunit, report,... for exporting this info, use type FILE.
With this you can write line by line and they are automatically with CR/LFRegards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Thank you for your answer, kriki
But my problem is, that I have one line for each contact witch several export fields like amounts, description and so on.
And the last field for a line is the contact information which is written in one field (text 250)
I want to format the last field like this
"name <newline> address <newline> city" and so on.
Later, if the export file is merged by word, my textfield should be showed in word like this:
name
address
city
The new line after a complete line works wellMany thanks, Roger0 -
Hi Roger
Try this
// CR and LF are of type character
CR := 13;
LF := 10;
element := contact.name + Format(CR) + Format(LF)
Regards
Thomas0 -
<newline> is used to divide the different records created in a dataport.
Now you want also to use it internally in a field, so you will have something like:
amount ; some other amount ; description ; yet another amount ; name <CRLF> adress <CRLF> <CRLF(created by the dataport because next record starts after this)>
amount ; some other amount ; description ; yet another amount ; name <CRLF> adress <CRLF> <CRLF(created by the dataport because next record starts after this)>
and so on.
So the output will be (seen by Notepad)
amount ; some other amount ; description ; yet another amount ; name
adress
amount ; some other amount ; description ; yet another amount ; name
adress
and so on.
I think this creates some confusion for mailmerge.
So I still think that the best method is still writing a file with the FILE-type, and this is what you get:
amount
some other amount
description
yet another amount
name
adress
amount
some other amount
description
yet another amount
name
adress
and so on.
Can't you put the address-fields together for merging?
or you can check if merging uses a special character (Navision uses for exemple the backslash (=\) ) that it interpretes for a CRLF. In this case you can use that character in your big address-string.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi Thomas
Thank you for your help.
But I tried this before I have posted my problme in forum.
Word is not able to process an ascii-file with this characters in a datafieldMany thanks, Roger0 -
Thanks for all help
It seems, there is no way to handle it.
So, I have decided to use different fields, that works properlyMany thanks, Roger0 -
but how can you build a file path for example 'c:\test.txt'?0
-
I have 2 text variables:
Path := 'C:\';
Filename := 'test.txt'
When I try to concatenate'em I get:
C:
test.txt
instead of C:\test.txt
What I want is to avoid the "new line" meaning of the \ character.0 -
I have a dataport I export with - and the Filename is a variable that can be entered in the Request Form
For example
OnPreDataport()
CurrDataport.FILENAME('C:\'+YourFileName+'.txt.');
Variable name is YourFileName type TEXT size 30
That's if you don't want it set in stone.
----
Also as I re-read this post - I am wondering..
Are just simply trying to create a file that word can use to create merged documents?0 -
I suppose you see that if you do a MESSAGE(Path + Filename);florynx wrote:I have 2 text variables:
Path := 'C:\';
Filename := 'test.txt'
When I try to concatenate'em I get:
C:
test.txt
instead of C:\test.txt
What I want is to avoid the "new line" meaning of the \ character.
If you do a MESSAGE('%1',Path + Filename); you will see "C:\test.txt".
So the filename will be correct.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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