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

Exporting to Text file

Status
Not open for further replies.

MikeCitizens

Technical User
Aug 13, 2002
37
US
Hello,
I need to export from a crystal report to a text file. This text file will then be sent to a mainframe. Every time I export the file I get a space at the begginning of every line. How do I get rid of this space?
Also, I need to have 20 spaces at the end of each line. The mainframe requires files to be 80 positions long. Crystal drops these spaces off when exporting. How do I get crstal to keep these spaces in the file?

Any one run into this problem? Any help on this would be grealty appreciated.

Mike at Citizens
 
the way I do it is create a single formula that displays all my data...in your case it sounds like you are creating a "report" vs a data file so I'd do it like this...

for each column you need in the file create a formula that sets the width of the column:
left({first.field}+space(15),15)

etc...

then create the display formula
{@formula1}+{@formula2}
etc...you then control the spacing exactly...also make sure for this you use the usftext.dll version 6.0.0.17 not the later version as they rely on screen resolution and will get way too "smart"
 
Hello,
Thanks for the responses. I haven't had much luck though. I tried to create a single formula that displays all my data. But the space at the start of each line still was there and it still dropped off my 20 spaces at the end of each line. I also tried to download the patch above and it still didn't resolve the issue. The patch has a date on it of 8/1 is that different from the one that you downloaded??

any futher help would be greatly appreciated.

Mike
 
I actually found a half-fast way of getting the file correct. If you save the file to a .csv format then open the file in excell. By placing a page break and saving only the one column you exported this to, you can save it to a text file. Both space problems are resolved. This of course was using the above suggestion that the whole report is in one formula.

Thanks for the suggestions

Mike@citizens
 
NH Hogan's reply was the best - use the patch! It works great. Apply it once and eliminate that space at the beginning of each line for good!

MJ
 
I downloaded the patch and it didn't work. I noticed that the patch had a date of 8/1 on it. Did you use a diffeent patch then what they have on their web-site?
 
I went into the patch and selected only the export to text update piece of the patch. This worked and I am allset thanks for your help.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top