Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal report export to CSV

Status
Not open for further replies.

idehen

Technical User
Oct 26, 2004
92
GB
Good day,

Hoping someone can help. I exported my report from crystal report to CSV format with the headers and all columns coming out right as expected. I have a client platform that says a file must be imported as CSV and the CSV format exported from crystal report seem to fail during import to the client's platform.

When I copy and paste the header columns from the template provided by the client over to the Crystal report's CSV export, and then import the file on the client platform, this seems to go through Ok. Is there something i am doing wrong. I am trying to avoid any manual inputs and just have a report that exports to CSV and then can be imported to a platform.

During my export from crystal report to csv, i selected the option Isolate Report/Page sections.

Any help or advise will be appreciated. Thanks
 
Without knowing why the import fails, it will be hard to diagnose. It could be data types, NULLs, etc.
 
I understand what you mean. Problem is how do i diagnose this?

Just reading through the document provided along side the template from the client about upload to the platform. It says must be CSV and column headers have Carriage return line feed (Crlf) as end of line delimiter. I am going to try adding Crlf to the header column names using a formula "textname"&chr(13). I'll advise if this works.
 
Note that the ASCII code for line feed is chr(10). I wonder if they are asking for both a carriage return chr(13) and a line feed.

-LB
 
Just tried "textname"&chr(13) and that didn't work. trying "textname"&chr(13)&chr(10) and if this doesn't work, i'll change this over as "textname"&chr(10)&chr(13) to see if it works. Thanks for all your response. I will advise shortly or let me know if the formula should be written in a different way.
 
If this is due to BOM issue, there are several ways to get around that.
Are you addressing an interactive use case (user running report inside Crystal Designer or a Crystal Viewer) or an automated scenario (scheduled, command line, desktop shortcut)?

view, export, burst, email, and schedule Crystal Reports.
 
Neither "textname"&chr(13)&chr(10) nor "textname"&chr(10)&chr(13) has worked.
IdoMillet - I don't think issue is with BOM. What I have tested so far is that, I run my report and export to CSV. So far so good. When I try to import into the client's platform it fails. When I take the CSV template the client provided and copy the header column titles over my exported csv titles (override), import is successful.

Note. I have checked the column titles up to the smallest space, alignments, spellings etc. There is no difference to the csv I generated. I have decided to send my CSV to the client and ask they check and advise why the file is not importing, maybe they could provide a starting point.
 
Still sounds like a BOM issue to me.

If it is, at least one of the 3rd-party UFLs listed here provides control over the emitting of BOM in writing the report data to a a text (.csv) file.

view, export, burst, email, and schedule Crystal Reports.
 
Also, at least one of the 3rd-party Crystal report automation tools listed here allows you to use the "good" header file and simply append the csv export to the existing header (while removing the header from the export).

view, export, burst, email, and schedule Crystal Reports.
 
Not sure if this is relevant, but to my surprise, I couldn't get the chr()'s to create the return/line feed without adding a space to the end of the formula:

&" "

Not sure how this would play out in a cvs export.

-LB
 
Thanks for all your inputs. I went back to the company we are importing the file on their platform with the files rejected and they confirmed there was an issue with the template they provided and sent through a revised template with different column names. Import is now successful without use of Carriage return or Line feed function mentioned above.

Only thing I noticed is that exporting the report to CSV from crystal report, there is the option to tick "Isolate Report / Page Sections" but when uploaded to an online platform infoview, this option is not available. Anyway round this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top