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

Export Crystal 7.0 problem with headings.

Status
Not open for further replies.

sonar1

Programmer
Mar 22, 2002
2
CA
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
 
Supress the headings, this will eliminate it completely. I've not been able to place just one at the beginning.

Hope it helps!
 
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.

-k kai@informeddatadecisions.com
 
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.
 
Infobabe,

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
tek@kenhamady.com
 
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.

Naith
 
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
 
To Naith,

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.

-k kai@informeddatadecisions.com
 
synapsevampire,

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
tek@kenhamady.com
 
The Character separated has the same header problem as comma separated, it just allows for quotes.

I used a chr(13)+chr(10) to issue a carriage return, but I notice now that I get an extra comma or quote corruption depending upon the choice made.

Here's a better solution for either Comma separated or Character separated exports:

Add 2 formulas to use as groups:

// Outside grouping
@PageHeaderGroup:
whilereadingrecords;
false

// Inner grouping
@KickaCR:
whilereadingrecords;
false

Suppress the footer for @PageHeaderGroup

Suppress the header and footer for @KickaCR

Place your headers in @PageHeaderGroup

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.

I know, kinda hokey, but it works...

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top