Create Fixed length text file from Customer Record

colingbradley
Member Posts: 162
NAV2009 Classic Client
I have a need to automatically create a file in text format, fixed length whenever the OnModify is triggered for Table 18.
Dataports are no longer supported so I am assuming I will need to write a processing type report.
The BACS report looks like it may fit the bill but that is CSV output.
Anyone have a worked example please or any pointers.
Many thanks,
Colin
I have a need to automatically create a file in text format, fixed length whenever the OnModify is triggered for Table 18.
Dataports are no longer supported so I am assuming I will need to write a processing type report.
The BACS report looks like it may fit the bill but that is CSV output.
Anyone have a worked example please or any pointers.
Many thanks,
Colin
Experience is what you get when you hoped to get money
0
Comments
-
You can write something like this
NFile.CREATE('C:\Filename.txt'); NFile.open('C:\Filename.txt'); NFile.TEXTMODE(TRUE); NFile.WRITE('Enter Your Text Here'); NFile.CLOSE; Nfile is Variable of type file
0 -
Thanks Vijay,
I have that information, thanks.
I am keen to see an example of creating the file where the fields are in fixed positions.
I have examples where the file is deliminated with "(quotes) and ,(commas) but I need Fixed Position, example:
abc123^^^^^^^^^^^^^^^Systems Limited^^^^^^^^^^^^^^^^^^^77 High Street (where ^ = space or null).
Not "123","Systems Limited","etc....
This is what I have after working through the problem:
linepart[1] := padstr("no.",maxstrlen("no."),Space);
LinePart[2] := padstr(Name,maxstrlen(Name),Space);
LinePart[3] := padstr("name 2",maxstrlen("name 2"),Space);
LinePart[4] := padstr(Address,maxstrlen(address),Space);
LinePart[5] := padstr("Address 2",maxstrlen("Address 2"),Space);
LinePart[6] := padstr(City,maxstrlen(city),Space);
LinePart[7] := padstr(County,maxstrlen(county),Space);
LinePart[8] := padstr("Post Code",maxstrlen("Post Code"),Space);
LinePart[9] := padstr("Country/Region Code",maxstrlen("Country/Region Code"),Space);
LinePart[10] := padstr("Currency Code",maxstrlen("Currency Code"),Space);
LinePart[11] := padstr(Contact,maxstrlen(contact),Space);
LinePart[12] := padstr("Phone No.",maxstrlen("phone No."),Space);
LinePart[13] := padstr("Fax No.",maxstrlen("fax No."),Space);
LinePart[14] := padstr("VAT Registration No.",maxstrlen("VAT Registration No."),Space);
LinePart[15] := padstr("Payment Method Code",maxstrlen("Payment Method Code"),Space);
LinePart[16] := padstr("E-Mail",maxstrlen("E-Mail"),Space);
Line := LinePart[1] + LinePart[2] + LinePart[3] + LinePart[4] + LinePart[5] +
LinePart[6] + LinePart[7] + LinePart[8] + LinePart[9] + LinePart[10] +
LinePart[11] + LinePart[12] + LinePart[13] + LinePart[14] + LinePart[15] +
LinePart[16];
I get a fixed length output file. \:D/Experience is what you get when you hoped to get money0
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