Hello,
How can we Export specific report into CSV format output file in specific location. The CSV File should be in specific format that matches the Layout of the report.
Thank you.
*This post is locked for comments
Hello,
How can we Export specific report into CSV format output file in specific location. The CSV File should be in specific format that matches the Layout of the report.
Thank you.
*This post is locked for comments
I know this is a very old post but I am trying to do what your reply is explaining however I am VERY new to coding. I am trying to out put a .csv file from a report. The reason I am doing it this way is because this is something that Accounting will do a few times a week and they do not have access to run XMLPorts in the development environment. Is this something that you can help me with?
Thank you in advance.
Troy
you get a similar result, when you create a xmlport with dataitems according the report and output format csv.
I achieved this by copying each record generated inside report into a text[1024] variable and then transferring data into a file which was later used for creating a CSV file...
CODE:
ltx_Line := ltx_Line+ ltx_CRLF + "Check No." + ','+ Description+ ',' +FORMAT(Amount)...;
where ltx_Line holds the value of each record and later i transferred the value accumulated to a file which can be copied to a CSV file create by code:
//-------------
lfi_ExportFile.CREATE('C:\MyNewFolder\test.csv'); //Create a file in specified destination
lfi_ExportFile.WRITE(ltx_Line);; // This will transfer data from text variable to the file
//-----------
Alternative to keep all file in a same text: I can directly export to file everytime, this will prevent from error message of Data Overflow..
lfi_ExportFile.WRITE(ltx_Line); //This can be used inside a loop-->every line will be copied to ltx_Line & get copied to CSV file instead of storing multiple line
lfi_ExportFile.CLOSE; // This will close the file
//----------
In order to create a new line i used ltx_CRLF:
ltx_CRLF := '';
ltx_CRLF[1] := 13;
ltx_CRLF[2] := 10;
//------
The same pattern can be used to export Data from a Table to CSV file as well... and it works in both classic and RTC reports...
Thanks...
export the report as excel report e.g. using saveasexcel, then convert to csv (in excel or programmatically using .net). so you get a csv file with layout that matches the report layout.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156