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

Fixed length text output

Status
Not open for further replies.

dwanjk

Technical User
Nov 24, 2008
7
US
Hi All,

I am writng a crystal report that needs to produce a fixed length (300bytes)output.I have read many posts regarding exporting to a .txt document and have benefitted from those posts along the way. One of my final issues is that the last 24 characters need to be blanks. In crystal the blanks are displayed, however, in notepad the .txt drops the blanks, leaving me with 276 bytes.

The formula that I am using is 'replicatestring("0",12) + replicatestring(" ",24)' to produce th following output... "000000000000 "

If there is anyone that can provide some insight into this problem I would much appreciate it :)

janine
 
I meant to say that the output should be "000000000000 " (or 12 "0"'s followed by 24 blanks)
 
To pad a number with leading zeros

totext(numberfield, '000000000000', 0,"")

Ian
 
for grins i created a formula with your code (replicatestring("0",12) + replicatestring(" ",24)) and exported to text and the training spaces exported exactly as expected. How are you getting the info to notepad from your report?

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
trailing*

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top