I'm trying to export a report using Crystal 7.0 into a csv file but I get the headings on every line. I would like the heading once only at the top - any suggestions.
I have the same issue. In fact, I don't care to have any headings at all. Data is going to a comma sv which is already mapped in my target app. Seems a program that is so flexible as to have unimaginable variables gets bogged down in its own complexity.
John
You might consider cheating this for export by conditionally suppressing the headers area that you don't want by using a parameter to ask if this is for export, then when it's for display, it has headings, if for export, it eliminates them and you have just data.
I don't really consider their CSV a real CSV since it doesn't handle headers correctly.
All export format types are not equal. There is some information about export limitations in the Seagate knowledgebase. CSV will put your header on every line. There is, however, a way to beat the system if you want a header on a CSV file.
Instead of placing your header fields in the report header, suppress the report header. Create a group based on a formula @All that will include every record in the report--something like customerID > 0. Make sure this group is positioned at the highest level and line up your header fields in this section. The header line will appear once at the beginning of the file.
Now that is a surprise. I have assumed that you would get the GH fields on each row.
However, I get a strange behavior. When I tested it I get the first detail stuck on the end of the header fields. Do you get that also? I get the same in v7 and v8.5 Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
I'm using version 8 and I'm not getting the strange behavior you describe. I tried putting the values both in detail and in another group section and it still formats OK. Crystal, however, is fussy about placement of fields in the case of exports. I make every field and formula the same length, align left, use guidelines, and overlap the fields with a slight offset rather than putting them side by side. This gives me more room than a page normally allows and eliminates inadvertent blank columns. Also I use Excel instead of CSV; there are fewer problems.
Well that's why you're not getting the problem then. Excel's export dlls are more dependable than that of the csv. If I export to Excel on 8.5, headings are absolutely a-okay. But, exporting to csv - even with your nice constant group trick, I still get the anomaly Ken experiences.
Well, thanks to all but I got it to work by staying away from the Report Expert.
I hand placed all the data I wanted in the detail area, placed no heading and exported to Excell. Exactly what I deeded.
Funny thing however, the same setup, exported to comma sep value .csv had some hard coded entries (done with a formula placing the text in quotes) came into the .csv with those quotes but the ODBC data had no quotes. Same with the character sep value export. Again, I thought a true .csv file's records always has the "data","moredata",... format. Learn something new everyday.
I'll have to try just putting a text field in the detail instead of using a formula and see how that works.
Thanks again,
John
I normally use Excel export, but for purposes of solving the original problem, I was able to export to CSV using the @All group as described without the anomaly. Don't know why.
Consider wrapping all text fields in quotes if that's a requirement.
Infobabe: Interesting trick, thanks.
Ken: To correct the first line problem, try adding a chr(13) to the end of the group header.
jgriffs: I tend to use the character separated values and use a comma, it allows you to decide whether to use the quotes. The CSV isn't what most consider a CSV, and it's pretty much useless to me.
I tried it a couple of ways and it didn't work. How would you add the CHR(13)? I also noticed that I got the same behavior on Character Separated, but not Tab Separated. That worked fine, giving a single line description at the top. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
The result will be a Comma (or other) Separated Value file which allows for turning off or on the quotes (if you use the Character Separated Values), and you can select a different delimiter.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.