Hi All,
I want to export customers as a CSV file using Jobqueue.
Can you please provide me a piece of advice, whether i am creating code unit or report to run a jobqueue.
If it's possible through codeunit or report, please suggest me some piece of code to export a CSV file.
Thanks in advance,
Jacob.A
0
Answers
Tomorrow you'll have an example. If no one beats me to it.
https://forum.mibuso.com/discussion/65967/export-to-csv-via-report-nav2015
If you really want to use a report, you could use a "File" variable, but make sure you are not putting it on the server.
OnPreDataItem()
IF NOT FILE.EXISTS(<Your FileName>) THEN
FILE.ERASE(<Your FileName>);
fileExport.CREATE(<Your FileName>);
fileExport.TEXTMODE := TRUE;
fileExport.WRITEMODE := TRUE;
OnAfterGetRecord()
fileExport.WRITE(STRSUBSTNO('%1;%2;%3;%4;..",
<Your Values>);
OnPostDataItem()
fileExport.CLOSE;
Tally,I have done it.Can you please tell me how to include a header?
IF FILE.EXISTS(<Your FileName>) THEN
FILE.ERASE(<Your FileName>);
fileExport.CREATE(<Your FileName>);
fileExport.TEXTMODE := TRUE;
fileExport.WRITEMODE := TRUE;
fileExport.WRITE(STRSUBSTNO('%1;%2;%3;%4;..",
<Your Header Values>);
OnAfterGetRecord()
fileExport.WRITE(STRSUBSTNO('%1;%2;%3;%4;..",
DELCHR(<Your Values>),'=',STRSUBSTNO('";');
OnPostDataItem()
fileExport.CLOSE;
I have tried with your code but not able to include a header.
please look at my code and suggest me the changes.
I got it .It works well now.Header also included.Thank u once again.