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!

Fixed Width Report - Problem First Field

Status
Not open for further replies.

reportdr

Technical User
Apr 11, 2006
10
Hello

I have created a report for a 3rd party vendor who reuqires a certain format for importing into their system. I export as tab separated values though set up as fixed width. Everything is working perfectly except the first field imports with a bar at the start and a quotation mark at the end. The formula:

numbervar requiredlength:=4;
numbervar currentlength:=length({@Salutation});

if currentlength<requiredlength then
{@Salutation}+replicatestring(" ",requiredlength-(length({@Salutation}))) else
if currentlength>=requiredlength then
left({@Salutation},requiredlength)

The value of Salutation is simply "".

Please note that the creation of this field is exactly like I created any other field that was required to be set up even though the fields are blank.

Can someone please help? Thanks.

S.
 
If {@Salutation} is blank then why would you bother with this formula and not just use 4 spaces?

You stated The value of Salutation is simply "".

Perhaps you meant something else by that...

Anyway, since your post doesn't make any sense, just use brute force:

numbervar requiredlength:=4;
numbervar currentlength:=length({@Salutation});
stringvar Output:="";
if currentlength<requiredlength then
Output:= " "+mid({@Salutation}+replicatestring(" ",requiredlength-(length({@Salutation}))),2,2)+" "
else
if currentlength>=requiredlength then
Output:= left({@Salutation},requiredlength)

-k
 
Hi

Thanks for the suggestion but it still isn't working - same characters show up.

Anyone else?

S.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top