Exporting data using Dataports
vbraganca
Member Posts: 4
Hi,
How can i export data of 2 tables that must be linked by some fields (ex.: Production Order and Production Order Line) to a .txt file using only one dataport.
Thanks
How can i export data of 2 tables that must be linked by some fields (ex.: Production Order and Production Order Line) to a .txt file using only one dataport.
Thanks
0
Comments
-
Just create a dataport with 2 DataItems. Indent the second one, and in the properties make a DataItemTableView from the first.
Look at the Application designers guide for more information.0 -
I've already did this but when i indent the second Data Item and try to compile, i receive a error message saying that the file format is not in UPXML.
And i want to export to .txt format0 -
Look at the Dataport Properties. Probably you have the FileFormat in UPXML (only in User Portal), and you need Variable or Fixed, depending on the txt you want.
Good luck0 -
Hi
What i mean is that the error message appear only when the File Format in not UPXML. And because i want to export with a File Format = Variable, i get this message.
Thanks0 -
Hi
One cannot indent a dataitem in a dataport. One can have multiple dataitems but not idented for import/export.
That is specially kept for usage in User Portal.
RegardsRegards,
Tushaar0 -
The best way to do this is to create a report and define a file as export file.
Roelof.Roelof de Jonghttp://www.wye.com0 -
It's possible.
Make a global variable for the production No and one for the production status (these fields are the primary key)
Now fill these fields in the OnAfterExportRecord from the production order DataItem like this:
VariableStatus := Status;
VariableProdOrderNo := "No.";
Go to the production order line dataitem and admit the following code in the OnPreDataItem trigger:
SETRANGE(Status,VariableStatus);
SETRANGE("Prod. Order No.",VariableProdOrderNo);
FIND('-');
And that's it !
Good Luck !0 -
Evert,
That doesn't work. At least if I get you right.
The problem is that you can't indent on a dataport. It means that first all records of DataItem 1 (Header) are being exported. After that, DataItem 2., the lines, will be exported. Problem here is, how do you know which lines?. An alternative would be to create a temp file during the export of the Header records, to capture the key fields for the Lines (or an array if not too many records involved).
Roelof.Roelof de Jonghttp://www.wye.com0
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
