Dear All,
A dataport is customized to create a csv file. After that a third party tool consumes this csv file for internal use.
Dataport has the following propertities .
1. FieldStartDelimiter =<">
2. FieldSeparator = |
As dataport is not acceptable in NAS environment & the client does not have xmlport executable permission in their license. So,
I have given a task to generate the same csv file without using any dataport/xmlport.
To do this I have created a Codeunit to generate the same csv file using Excel Automation in same database. I have checked the csv files generated from the codeunit is perfectly matching with the dataport generated csv file.
But the 3rd Party software is not accepting the codeunit generated csv files due to find inappropiate character in the files. :shock:
How does the 3rd Party Software see the codeunit generated files is given in an attachment files.
How to solve this type of issues ?
Now or Never
0
Comments
Check in Notepad..
| is not av valid field separator in csv format...Excel therefore consider the |-s to be alfanumerical fields, and add "" around them before saving the file.
If you use Excel Automation to generate the file, and save the file via .SaveAS method, excel will add the "'s
Save the file via File or OutStream instead
Files are similar in Excel view only.
As per the requirement of the third party tool we have to consider the | as a field separate.
I hope C/AL can do the same task as dataport can do.
Using Excel Automation & SaveAs(FileName,6) function I am trying to achieve the same.
Files are similar in Excel view only.
As per the requirement of the third party tool we have to consider the | as a field separate.
I hope C/AL can do the same task as dataport can do.
Using Excel Automation & SaveAs(FileName,6) function I am trying to achieve the same.
So, along with eyolftho, I strongly advise to use outstream and it's TEXTWRITE function (It's much more reliable and more easy to control that FILE's TEXTMODE WRITE).
Forget about excel, both, as a means to create the file and as a means to verify it.