Dataport Export multiple tables to multiple text files
Hi,
I have 3 dataports that export posted invoice data to an external system - they each export into their own text file:
Sales Invoice Header
Sales Invoice Line
Sales Comments
The dataports all work fine.
I would like to allow the user to export all 3 text files using one dataport. Each dataitem, however, needs to continue to be exported separate text files.
I know that I could, for example, create a ProcessingOnly Report that would call each dataport in succession, building in functionality to set the proper export filename, etc.
I'm trying to determine if there is an easier way.
I've used the technique for collecting the export filename via a custom request form, so I'm familiar with that.
I'm not sure, however, if I can use the CurrDataport.FILENAME function to change the file name at the beginning of each dataitem in the dataport.
Does anyone know for certain? Or is it time for the "Just try it and see if it works" method <grin>.
Thx
Ron
I have 3 dataports that export posted invoice data to an external system - they each export into their own text file:
Sales Invoice Header
Sales Invoice Line
Sales Comments
The dataports all work fine.
I would like to allow the user to export all 3 text files using one dataport. Each dataitem, however, needs to continue to be exported separate text files.
I know that I could, for example, create a ProcessingOnly Report that would call each dataport in succession, building in functionality to set the proper export filename, etc.
I'm trying to determine if there is an easier way.
I've used the technique for collecting the export filename via a custom request form, so I'm familiar with that.
I'm not sure, however, if I can use the CurrDataport.FILENAME function to change the file name at the beginning of each dataitem in the dataport.
Does anyone know for certain? Or is it time for the "Just try it and see if it works" method <grin>.
Thx
Ron
Ron
0
Answers
-
rsaritzky wrote:I'm not sure, however, if I can use the CurrDataport.FILENAME function to change the file name at the beginning of each dataitem in the dataport.
Does anyone know for certain? Or is it time for the "Just try it and see if it works" method <grin>.
In all seriousness, did you try it? It would probably have taken you less time to try it than to write out all this as a question.David Singleton0 -
Actually it took me only a minute to write the question, and will take more time to test it/try it than that. But I WILL try it and post my results.
Thx
RonRon0 -
For the benefit of others, I did complete testing this, and you CAN create separate export files in a multi-dataitem dataport.
I prompted the user for the path and "base" portion of the filename, e.g. C:\EXPORTS\BATCH123 (this stored in a global variable "Filepath")
Then, in the OnPreDataItem section of the first (header) dataitem, I entered:
CurrDataport.FILENAME := Filepath + '_header.txt';
In the second dataitem:
CurrDataport.FILENAME := Filepath + '_line.txt';
and in the third:
CurrDataport.FILENAME := Filepath + '_comments.txt';
Result was exactly what I was hoping for - 3 separate export files.
RonRon0 -
:thumbsup:
Wax on Wax off 8)David Singleton0 -
You can use the same method to import multiple files as well.
David Machanick
http://mibuso.com/blogs/davidmachanick/0 -
Thanks, I was in need of this solution. I got it...--
Regards,
Raveendran.BS0
Categories
- All Categories
- 75 General
- 75 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
