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

Blank Line Suppression - Formula 2

Status
Not open for further replies.

REENI

Technical User
Jul 4, 2001
12
0
0
GB
HELLO ALL,

I'm currently trying to setup a Crystal Report in the form of a letter. I have a problem where blank lines are concerned and want to suppress such fields. I'm using Goldmine fields to set this report.

the formula I was suggested to use was

>>>> global stringvar address1 := "";
>>>> global stringvar address2 := "";
>>>> global stringvar address3 := "";

>>>> if not isnull({contact1.address1}) or {contact1.address1}
>>>> <> &quot;&quot; then address1 := {contact1.address1} + chr(13);
>>>> if not isnull({contact1.address2}) or {contact1.address2}
>>>> <> &quot;&quot; then address2 := {contact1.address2} + chr(13);
>>>> if not isnull({contact1.address3}) or {contact1.address3}
>>>> <> &quot;&quot; then address3 := {contact1.address3} + chr(13);

>>>> address1 + address2 + address3

THIS FORMULA RETURNS A NULL FIELD IF ANY OF THE ADDRESS FIELDS ARE BLANK AND DOES NOT SUPPRESS!!

CAN ANYONE HELP ME?

THANKS

REENI
RD ASSOCIATES


 
What if you replace your three OR words with AND.

I assume that you can't have three separate sections, one for each field, and then use the setting &quot;suppress blank section&quot; to eliminate the section when the field is blank?

Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Hi Reeny,

The second option is,

u place one blank text box, address1, Address2 and address 3 on your report.

Now u drag address1 in blank text box, u can see the change of mose pointer, than drag address2 in the text box & than address3.

Now in the text bos u can see all your 3 fields, u press enter betwwen address1 & address2, than press enter between address2 & address3.

Set your text box in necessary place. then try.

It will automatically suppress the blanks.

I am using it successfully in my many projects.
 
I frequently have to generate addresses from a database, and I always find that putting each line of the address on a separate details line, and then suppressing that line if it's blank, is the surest way to get the result you want.
 
I am trying to use this formula to suppress blank lines. But it displays only if all 3 fields are not blank.even if one field is blank it doesn't display anything.
Please can someone what is wrong with this formula?

iif(length({CONTRACT_SITE_ITEM.PRIMARY_ADDRESS}) > 0,{CONTRACT_SITE_ITEM.PRIMARY_ADDRESS}+chr(13),&quot;&quot;) +iif(length({CONTRACT_SITE_ITEM.P_ADDRESS_2}) > 0 ,{CONTRACT_SITE_ITEM.P_ADDRESS_2}+chr(13),&quot;&quot;)+iif(length({CONTRACT_SITE_ITEM.P_CITY}) > 0 ,{CONTRACT_SITE_ITEM.P_CITY},&quot;&quot;)

Thanks,
Arthi
 
I'm not sure how you would code this up in VB, but using crystal reports, I would just drag all of the field objects to the report details section and format the section as &quot;suppress blank section&quot;. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
You are probably running into nulls. One null value makes a formula stop working. Rather than checking length, use:

if IsNull ( {field} ) ... Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top