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
Ron
0
Answers
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.
Thx
Ron
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.
Ron
Wax on Wax off 8)
http://mibuso.com/blogs/davidmachanick/
Regards,
Raveendran.BS