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!

Exporting to CSV results in the page header appearing with every recor

Status
Not open for further replies.
Is the report designed specifically to be exported to CSV? If so, do you really need a page header (CSV is not "paged" per se) or could you use a report header instead?

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Thank you all,
Export to csv with report and page header is a client request can't change it. The report is designed to export to csv as part of automated process.

Thank you
Back2tek
 
Have you looked at using a group header and "Repeat group header on each page"? This will give you the page headers and it should export to the top of the file. If your data is not set up so that you could have a single "master" group, you could create a formula for a "dummy" group that would only create a single group.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Have you tried the solution indicated in the Business Objects link you provided? Despite those comments in your link, the BO fix does work - or at least it did for me when I was running a CE 9 environment. You should at least give it a shot.
 
Thank you all. I tried all your suggestion nothing worked. I really don't understand how CR can have this issue whitout a fix for so long. I used CR9 and XI I got same result.
 
It's not an issue with CR. .csv is not designed to have header information. .csv files are most often used as a way to import data into a database. As such, a header is not necessary, only the data is.

With that knowledge, you could manipulate the data in such a way that the first line of "data" contains the header information. If you were to base your report off a SQL Command Object, view or stored procedure then I would recommend using a UNION ALL in the following manner:

--This section returns hardcoded column names
"header1" fieldname,
"header2" fieldname,
"header3" fieldname,
etc...

UNION ALL

--This section returns the actual data
field1 fieldname,
field2 fieldname,
field3 fieldname,
etc...

~Kurt

~Kurt

 
Hi Kurt,
Isn't "Union all" require same number of fields and same data type for both queries ?

Back2tek
 
Yes, it does. Since you'll have one header per field, you'll have the same number of fields in each part of the query.

The downside is that you'll have to convert all of the data elements to string datatype (char, varchar, etc...)

Ultimately, this is a kluge, but it will accomplish the goal of creating a header for .csv export.

~Kurt

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top