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

Export Report as Text With Field Length

Status
Not open for further replies.
Dec 13, 2004
63
US
I am using CR10 with a Oracle DB.

I have a report that I would like to export into text format with the fixed length of the fields/strings. Does anyone know how to do this?

For example:

If the Last Name is set at 20 for the field size, I would like to export that field size into a text file.


I used the export feature and exported the file Text and Tab Separated Text but the length of the fields are not the same in the Text file.

Please help!
 
The length of the fields will be the length of the fields at export time, not what the original size is.

To allow for creating fixed length fields, pad the fields, such as:

{table.field}&ReplicateString(" ",40-len(trim({table.field})))

Replace the 40 with the length you need for that field, and {table.field} with your field.

If you have dates, numerics, booleans, etc., you'll need to convert them, as in:

whileprintingrecords;
stringvar MyDate1:=totext({table.date1});
MyDate1 & ReplicateString(" ",40-len(trim(MyDate1)))

-k
 
I had a similar problem. Field must indeed be fixed-length, but it also worked much better when I used Text rather than Tab-separated. I also chose 'Do not paginate' and set the 'characters per inch' to the maximum, 16 in my case. And set the font to 'Courier', which uses exactly the same space for each letter rather than adjusting it as most computer fonts will do.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top