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!

Formatting text for a form letter 1

Status
Not open for further replies.

aaronburro

Programmer
Jan 2, 2003
158
US
This is a really stupid question, but I can't bloody install the Crystal help files. Anyway, I'm trying to do a form letter and anywhere there is an actual field in the text forces a CR/LF before the field. Its annoying. How do I make it stop?
 
Indeed, it is annoying, please post your bloody software version.

There's a known issue for CR 8.5:


I can't really understand what your problem is, perhaps you can rephrase it "anywhere there is an actual field in the text forces a CR/LF before the field"

How did a field get into the text? Do you mean a memo field, or do you mean a Crystal text object, or?

Using real Crystal or database technical terms would be best.

If you're trying to say that you want to eliminate hard coded carriage returns from a field, try:

replace({TABLE.FIELD},chr(13)," ")

Then again they might have line feeds:

replace(replace({TABLE.FIELD},chr(13)," "), chr(10)," ")

If it's a memo field, then you might use a SQL expression to strip them, depending upon your version of Crystal, and the database type.

Posts that don't mention basic technical information are wasting everyone's time, including your own.

-k
 
sorry, i did neglect to mention that its 8.5. read my mind, synapesvampire ;) thx for the help, though. I'll go check that link.


by the way, the is just a basic numeric field from an invoice file. Its going into a Crystal text field, in form letter fashion. kind of a "you owe [x], pay up!" type thing.
 
ok, that link was for how to get the help file working :D

what happens is that the text just doesn't wrap around the end of the text block correctly, and it has problems specifically where database fields are inserted. thus, in my example above, there might be plenty of room for the entire sentence to be printed on the same line, but crystal is printing it like so:

you owe
[Table.amountOwed], pay up!

if I am lucky. It might do something even more unexplainable, but I think it all goes back to the same basic problem.
 
How are you entering the text for the letter? Is it entered directly into a text box, then you add the database field and then continue on with the text?

-LB
 
I can't recreate your problem. Did you check to make sure you didn't enter a return in the text box before adding the field?

-LB
 
Yep, absolutely certain that I didn't add a return. Are you ready for something wild? It only seems to add this mysterious newLine for the first field in the line of text (no <enter>'s). IE, all fields after the first one work fine. This seems to include formulas as well.

So, I got a solution, although not an elegant one.

Our company has made numerous attempts to clear up the [@Invoice(s)] listed below.
prints as:

Our company has made numerous attempts to clear up the
invoice listed below.

Adding an empty field (as in, a formula that returns an empty string) to the front of the line, however, makes it do this:

Our company has made numerous attempts to clear up the invoice listed below.

And, just for kicks, adding that empty field did not add an extra line. So, it sounds like I am either doing something ridiculously wrong, or we have found an "undocumented 'feature'" :D
 
Why would the output show the table.fieldname?

Please take time to accurately describe what is occurring. If it truly is displaying the table.field, then you may be in deep kim-chee there with your installation.

It also may be that you haven't made the field wide enough to handle the data.

And there isn't something unexplainable, take the time to describe it - perhaps inexplicable, but not unexplainable.

In lieu of dropping it into text, test with a formula containing:

"You owe " & totext({table.field},2,"") & ", pay up!"

-k
 
yeah, that might be a tad confusing. [@Invoice(s)] is a formula that I made that prints either "invoice" or "invoices," depending on if there are multiple invoices. [Table.amountOwed] is just the balance info for an unpaid invoice, and that displays a number, as it should.

As far as the field being wide enough, I've got the text box going from left margin to right margin. Thats the right way to do it, right?

I'll go give your suggestion a shot as well and see if that works.
 
synapsevampire, your suggestion works for the [@Invoice(s)] formula.

it also seems to work fine w/ the "pay up" line as well. great work, as usual!
 
Glad to hear you worked it out.

Not sure why the text field was flaking on you, but, it ain't broke now, so...

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top