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

Export file not retaining report format

Status
Not open for further replies.

blueboyz

Technical User
Sep 13, 2005
210
US
Crystal v9/Peachtree/Btrieve

I designed a simple report in crystal with text fields, a few formulas and data fields. The report is supposed to show the items sold, quantity sold, ship date, etc. for a specific period in time. The fields and tables used are irrelevant to my question.

I should email and attach my report and the exported file so you can see exactly what I see.

Here's the situation, I export the file with the format: separated values (CSV)to a disk file. I use the pipe
( | ) as the separator character and no delimiter. I open the file in Notepad and can see each record on a separate row, but the report footer is also at the end of each row. The report footer needs to be at the end of the file, not at the end of each row.

Is there a way to accomplish this?

My report is grouped by invoice #. I put all the fields in the in the Details section and then I have a few fields, including an item count in the report footer.

The exported file shows:
SIE1.2|12|24000|12|5329872200|R|20070101|SS|Siemens|SLATER|0001|SLATER|0001|123 Any Street|Boston|TX|75234|USA|214-234-5543|A&P AB|A&P METER SERVICE & SUP|MIDLAND|TX|79702|||20070117|20|2.00|SEA-01-20001-6|SEA-01-20001-6|6SE64000AP000AA1 420/440 AOP|UK|||||||PE|120.00|120.00|120.00|120.00||USD|1.00|EA|1|1902 S. TREADAWAY||BOX 10369|||END|12|24000|||||||||||||||||||||||||||||||||||||||||||||||||||19.00
SIE1.2|12|24000|12|5329872200|R|20070101|SS|Siemens|SLATER|0001|SLATER|0001|123 Any Street|Boston|TX|75234|USA|214-234-5543|A&P AB|A&P METER SERVICE & SUP|MIDLAND|TX|79702|||20070117|20|3.00|SEA-XS-10023-5|SEA-XS-10023-5|6EA79010BF000AA0 CABLE|UK|||||||PE|27.60|55.20|27.60|55.20||USD|2.00|EA|2|1902 S. TREADAWAY||BOX 10369|||END|12|24000|||||||||||||||||||||||||||||||||||||||||||||||||||19.00
SIE1.2|12|24000|12|5329872200|R|20070101|SS|Siemens|SLATER|0001|SLATER|0001|123 Any Street|Boston|TX|75234|USA|214-234-5543|3-G EA|3-G CONSTRUCTION|EAGLE PASS|TX|78852||20070115|20070101|23|3.00|SEA-XS-10008-5|SEA-XS-10008-5|6ES73921AJ000AA0 CONNECTOR|UK|||||||PE|19.80|118.80|19.80|118.80||USD|6.00|EA|3|2305 EL INDIO|HWY 343|2305 EL INDIO|HWY 343||END|12|24000|||||||||||||||||||||||||||||||||||||||||||||||||||19.00

This is a paste of 3 of the rows. Each record starts with: SIE1.2|12|24000|12|5329872200|R
You can see the "END" field in each record. I need the "END" field and everything afer it to appear only once in the file and that is at the end:
SIE1.2|12|24000|12|5329872200|R|20070101|SS|Siemens|SLATER|0001|SLATER|0001|123 Any Street|Boston|TX|75234|USA|214-234-5543|A&P AB|A&P METER SERVICE & SUP|MIDLAND|TX|79702|||20070117|20|2.00|SEA-01-20001-6|SEA-01-20001-6|6SE64000AP000AA1 420/440 AOP|UK|||||||PE|120.00|120.00|120.00|120.00||USD|1.00|EA|1|1902 S. TREADAWAY||BOX 10369|||
SIE1.2|12|24000|12|5329872200|R|20070101|SS|Siemens|SLATER|0001|SLATER|0001|123 Any Street|Boston|TX|75234|USA|214-234-5543|A&P AB|A&P METER SERVICE & SUP|MIDLAND|TX|79702|||20070117|20|3.00|SEA-XS-10023-5|SEA-XS-10023-5|6EA79010BF000AA0 CABLE|UK|||||||PE|27.60|55.20|27.60|55.20||USD|2.00|EA|2|1902 S. TREADAWAY||BOX 10369|||
SIE1.2|12|24000|12|5329872200|R|20070101|SS|Siemens|SLATER|0001|SLATER|0001|123 Any Street|Boston|TX|75234|USA|214-234-5543|3-G EA|3-G CONSTRUCTION|EAGLE PASS|TX|78852||20070115|20070101|23|3.00|SEA-XS-10008-5|SEA-XS-10008-5|6ES73921AJ000AA0 CONNECTOR|UK|||||||PE|19.80|118.80|19.80|118.80||USD|6.00|EA|3|2305 EL INDIO|HWY 343|2305 EL INDIO|HWY 343||END|12|24000|||||||||||||||||||||||||||||||||||||||||||||||||||19.00

Any help is greatly appreciated. I can also email the report file and exported file to you if needed.
 
First, a standard CSV doesn't have a footer.

Why are you grouping if you're displaying in the details, to provide the sort order?

I guess what you're asking for is a CSV but with a footer line at the end.

Right click the details and select insert section below.

In the oower details () place the fields that comprise the report footer portion.

Now right click each the Detail B section and in the X2 next to it:

//detailsb
not(onlastrecord)

-k
 
Thank you for your assistance "K". I tried what you suggested, but when I pull up the exported file in notepad, the fields that were in the report footer, but now in details b with "not(onlastrecord)" appear at the end of every row-just like before.

On the screen, the fields only appear after the last record.

Do you know if there is something else I can try?
 
I struggled with this lack in Crystal for 3 years (too long) and finally gave up. I ended up writing my own app to access the data and had it create a text file with file i/o. Crystal doesn't seem to understand that in the real world even csv files have Headers and Footers. At least that was the response I got from Crystal Support itself. I've never had to create one that didn't and I make a lot of EDDs(Electronic Data Deliverables).

Sorry, but I think you're out of luck. I had hoped they would have improved this with the new versions. If you find a solution, I for one would like to know. I might give it a try.

Crystal 8.5

Thanks,
Mary
 
Sorry, I forgot one thing that did work.
My report header was repeating for each line until I moved my report header to a group header.

Thanks,
Mary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top