| Author |
Message |
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|

Topic: Header Repeating exporting to .csv Posted: 05 Sep 2012 at 4:23am |
|
for some reason my header is repeating for every record all the way down the excel spreadsheet.
here is my code and i checked group settings and such to make sure that it's not set to repeat. any help would be great as i'm new to crystal reports.
WhilePrintingRecords;
Shared StringVar OutputFile;
StringVar Header := "";
Header :=
"LastName, FirstName, Annual Salary, FT/PT, Full/Part%, %Teaching, Ethnicity, Gender, AIMS Stats, NAIS Stas, RPCS Stats, Department, Adv. Degree" +
// Carriage Return / Line Feed Header := Header + Chr(13) + Chr(10);
// Write line to file mioMPAYIOAppendToFile (OutputFile, Header);
Header;
the actual header should only be across the top in individual cells and it's not. it's listed in one line and repeated for each employee.
thank you again in advance for any help or advice.
|
IP Logged |
|
|
|
comatt1
Senior Member
Joined: 19 May 2011
Online Status: Offline
Posts: 337
|

Posted: 05 Sep 2012 at 5:23am |
|
try when recordnumber<>1 then (Outputfile) else
(outputfile, header);
|
IP Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|

Posted: 05 Sep 2012 at 6:00am |
|
still returning header every other line for a new employee. i left just the header text and took out all code and it still does the same thing.
|
IP Logged |
|
comatt1
Senior Member
Joined: 19 May 2011
Online Status: Offline
Posts: 337
|

Posted: 05 Sep 2012 at 12:14pm |
|
are you exporting data only, xls?
|
IP Logged |
|
comatt1
Senior Member
Joined: 19 May 2011
Online Status: Offline
Posts: 337
|

Posted: 05 Sep 2012 at 12:16pm |
|
go to export options and open up the options tab, turn off "export page header and page footer"
|
IP Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|

Posted: 06 Sep 2012 at 4:46am |
|
the report exports to .csv i'm not seeing the turn off "export page header and page footer" option. i do want the header as the top of the spreadsheet then have the data fill in each corresponding cell beneath it.
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

Posted: 07 Sep 2012 at 4:26am |
Put the header in a Report Header section and the rest of your data in a details section. Also, you do NOT need to include the carriage return/line feed at the end of the formul - Crystal will automatically handle that in its export. -Dell
|
|
|
IP Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|

Posted: 07 Sep 2012 at 4:39am |
|
that is actually how i have it set up and it is still giving me a header for every employee.
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

Posted: 07 Sep 2012 at 4:58am |
Are you exporting to "Separated Values (CSV)" or to "Text"? Which version of Crystal are you using? If it's Separated Values, you should have an option on the final screen prior to export to "Isolate Report/Page Sections". Turn that on. -Dell
|
|
|
IP Logged |
|
|
|