Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Modifying @WorkLocation Post Reply Post New Topic
Author Message
grant21
Newbie
Newbie


Joined: 17 Jan 2008
Location: Canada
Online Status: Offline
Posts: 2
Quote grant21 Replybullet Topic: Modifying @WorkLocation
    Posted: 25 Jan 2008 at 7:04am
Hey all,
 
I'm using an integrated version of Crystal Reports 9 and am racking my brain with a few things on my invoice report.
 
In my @WorkLocation field, it adds 2 lines I don't care much for and would like to remove.  Currently it's giving me:
 
Primary
First Name Last Name
Attn: First Name Last Name
Address
City, State, Zip
 
How would I go about removing the "Primary" and Attn: Lines?  I also have that annoying Attn: line in my @BillToLocation field as well.
 
I can't seem to figure out what I'd need to modify in the formula, or if that's the right place to be.
 
@WorkLocation looks like this currently:
 
formula = ""

'Use the header?
IF NOT ISNULL({Invoices.WorkLocation_Header}) THEN _
    IF {Invoices.WorkLocation_Header} <> "" THEN _
        formula = {Invoices.WorkLocation_Header} & CHR(13) & CHR(10)

'Use the body?
IF NOT ISNULL({Invoices.WorkLocation_Body}) THEN _
    IF {Invoices.WorkLocation_Body} <> "" THEN _
        formula = formula & {Invoices.WorkLocation_Body} & CHR(13) & CHR(10)
 
'Trim any trailing carriage return?
IF RIGHT(formula, 2) = CHR(13) & CHR(10) THEN formula = LEFT(formula, LEN(formula) - 2)
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 25 Jan 2008 at 9:11am
Is Location_Header equal to "Primary"? If so, you can easily drop it by not using the first IF THEN statement of the formula.

Second, the body looks like it includes all the name and address info. You can get rid of that by parsing out the Attn: line. It's a bit more complicated, but you would use the InStr() function to determine where it starts and where it ends and then use parsing to concatenate what comes before and after it.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.