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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to CSV Header & Trailer Problem in CR9

Status
Not open for further replies.

SomeHelp

Programmer
Apr 11, 2002
31
US
The problem I am having with CSV export is that Crystal does not have a way to place the trailer record of the export on its own line. The header record and detail records work fine, but the trailer record gets appended to the end of the last exported record, instead being on its own line at bottom of file. I found this article on Business Objects web site that talks about CSV export and header/detail records and this solution works.


Here is how data gets exported:

header record:
value1, value2, value3

detail record:
value1, value2, value3, value4 value5 ... valueN

trailer record:
it gets put at end of last record in detail section
detail values1 ... valuesN, trailer1 ... trailerN

Any feedback on this would be greatly appreciated...
 
You might try a Text export and construct the comma delimited detail section by dropping formulas into a text object for each field which build the appropriate fields, as in:

+'"'+{table.field}+'",'+totext({table.value})+',' etc

-k
 
The problem seems to be around the fact that the export happens during the first pass of the report data and the CSV export driver does not perform a carrage return after detail section as you would assume, since the trailer record is in another section. It seems the header record issue was taken care of and I suspect that they will have to update their CSV export driver before trailer record will work. I have worked on this problem as well as Crystal Tech Support but they could not come up with a workaround to this issue so far. I am getting ready to submit a business case to their QA team to get this trailer issue resolved in a future update. I wanted to see if any Crystal guru's might have a workaround we have not tried.
 
That's why I suggested that you use the Text export instead.

Not sure if it will work, and it's dependent upon your version of Crystal.

I would drop the idea of using the CSV export and concentrate on alternatives, and if my solution does NOT work, let me know. I'm not interested in trying to pursue the CSV Export, rather using a Text export which will emulate a CSV.

-k
 
Thanks for your suggestion, it seems to be working utilizing the TEXT export instead of the CSV export. I really appreciate your feedback on this issue. I have sent this solution to Crystal Tech Support and see if this is a valid workaround for the issue or not. I will post update once I hear back from Crystal...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top