Printing Addresses

Thank you for posting all of your ideas. Like most development tasks there are multiple ways to achieve the same results.
I will post my code here in the event someone can recycle it later when printing addresses.
All I had to do was to add the parenthesis around each "IF" statement so that they stood on their own and weren't interpreted as being nested.


[cid:image003.jpg@01CAB480.3950CA50]




[cid:image004.jpg@01CAB480.3950CA50]
Dale Walker
Director, Information Technology
Le Sueur Incorporated
1409 Vine Street
Le Sueur, MN 56058
ph.507.665.6204 x277
fx .507.665.8466

www.lesueurinc.com<http://www.lesueurinc.com>




[Non-text portions of this message have been removed]
I am choking on a simple Crystal formatting issue having to do with printing addresses. Vantage allows addr1,2,3 but some of our addresses only use addr1. Some use addr1 and 2.

What I am wanting to do is to print only the non-blank addresses and have the city-state-zip print below the address lines with no blank lines.

I have a formula field setup as follows:

{ShipHead.shipToName}+ chr(13) +
If {ShipHead.shipToAddr1}<>"" Then{ShipHead.shipToAddr1}+ chr(13) +
If{ShipHead.shipToAddr2}<>"" Then{ShipHead.shipToAddr2}+ chr(13) +
If {ShipHead.shipToAddr3}<>"" Then{ShipHead.shipToAddr3}+ chr(13) +
If {ShipHead.shipToCity}<>"" Then{ShipHead.shipToCity}+", "+{ShipHead.shipToState}+" "+{ShipHead.shipToZip}
Else ""

It prints:
name
addr1
addr2

but nothing else...
Apparently when it hits the blank addr3 it wigs out and doesn't print the city-state-zip. I added the last "if" to check for a blank city not because any of them would be blank, but in order to seperate it from the "if" preceding it.

Any advice would be greatlyl appreciated.
Dale.
I think you can just put them in a text box and it will trim if blank
fields...

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of dswmaom
Sent: Monday, February 22, 2010 4:35 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Printing Addresses




I am choking on a simple Crystal formatting issue having to do with
printing addresses. Vantage allows addr1,2,3 but some of our addresses
only use addr1. Some use addr1 and 2.

What I am wanting to do is to print only the non-blank addresses and
have the city-state-zip print below the address lines with no blank
lines.

I have a formula field setup as follows:

{ShipHead.shipToName}+ chr(13) +
If {ShipHead.shipToAddr1}<>"" Then{ShipHead.shipToAddr1}+ chr(13) +
If{ShipHead.shipToAddr2}<>"" Then{ShipHead.shipToAddr2}+ chr(13) +
If {ShipHead.shipToAddr3}<>"" Then{ShipHead.shipToAddr3}+ chr(13) +
If {ShipHead.shipToCity}<>"" Then{ShipHead.shipToCity}+",
"+{ShipHead.shipToState}+" "+{ShipHead.shipToZip}
Else ""

It prints:
name
addr1
addr2

but nothing else...
Apparently when it hits the blank addr3 it wigs out and doesn't print
the city-state-zip. I added the last "if" to check for a blank city not
because any of them would be blank, but in order to seperate it from the
"if" preceding it.

Any advice would be greatlyl appreciated.
Dale.






[Non-text portions of this message have been removed]
I prefer to put each line in its own section and in the Section Expert
set the suppress section if blank flag.

This way the blank lines are compressed and you can use that space on
the paper in other sections.



Or

The other way is ugly but should work(I did not test the syntax in
Crystal)



If {ShipHead.shipToAddr3}<>"" and {ShipHead.shipToAddr2}<>"" and
{ShipHead.shipToAddr1}<>"" Then

{ShipHead.shipToName}+ chr(13) + {ShipHead.shipToAddr1}+ chr(13) +
{ShipHead.shipToAddr2}+ chr(13) + {ShipHead.shipToAddr3}+ chr(13) +
{ShipHead.shipToCity}+", "+{ShipHead.shipToState}+"
"+{ShipHead.shipToZip}

Else
If {ShipHead.shipToAddr3}<>"" and {ShipHead.shipToAddr1}<>"" and
{ShipHead.shipToAddr2}= "" Then

{ShipHead.shipToName}+ chr(13) + {ShipHead.shipToAddr1}+ chr(13) +
{ShipHead.shipToAddr3}+ chr(13) +
{ShipHead.shipToCity}+", "+{ShipHead.shipToState}+"
"+{ShipHead.shipToZip}

Else

......................... The remaining combinations ..........

Hope this helps



Dale E. Schuerman

Senior Consultant

Epicor Certified Consulting Partner



RAM Software Systems, Inc.

972-669-0763 x233 (voice)

972-669-9603 (fax)

mailto:dale.schuerman@...
<BLOCKED::blocked::mailto:dale.schuerman@...> (email)

http://www.ramsys.com <BLOCKED::blocked::http://www.ramsys.com/>
(website)





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of dswmaom
Sent: Monday, February 22, 2010 4:35 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Printing Addresses





I am choking on a simple Crystal formatting issue having to do with
printing addresses. Vantage allows addr1,2,3 but some of our addresses
only use addr1. Some use addr1 and 2.

What I am wanting to do is to print only the non-blank addresses and
have the city-state-zip print below the address lines with no blank
lines.

I have a formula field setup as follows:

{ShipHead.shipToName}+ chr(13) +
If {ShipHead.shipToAddr1}<>"" Then{ShipHead.shipToAddr1}+ chr(13) +
If{ShipHead.shipToAddr2}<>"" Then{ShipHead.shipToAddr1}+ chr(13) +

If {ShipHead.shipToAddr3}<>"" Then{ShipHead.shipToAddr1}+ chr(13) +

If {ShipHead.shipToCity}<>"" Then{ShipHead.shipToCity}+",
"+{ShipHead.shipToState}+" "+{ShipHead.shipToZip}
Else ""

It prints:
name
addr1
addr2

but nothing else...
Apparently when it hits the blank addr3 it wigs out and doesn't print
the city-state-zip. I added the last "if" to check for a blank city not
because any of them would be blank, but in order to seperate it from the
"if" preceding it.

Any advice would be greatlyl appreciated.
Dale.




########################################################################
Attention:
This email message is privileged and confidential. If you are not the
intended recipient please delete the message and notify the sender.
Any views or opinions presented are solely those of the author.

This email message has been scanned for Viruses and Content and cleared
by MailMarshal SMTP

For more information go to http://www.ramsys.com
########################################################################


[Non-text portions of this message have been removed]
Dale



Create a subreport and give each of the address lines it's own detail
section. Suppress the sections if blank and the address will
automatically shrink within a set subreport size. You can create more
subreports for other addresses if required



Gary



This e-mail and any files transmitted with it are confidential and are
intended solely for the use of the intended recipient(s). If you are not
the intended recipient, you must not copy, distribute or take any action
based on this communication. If you have received this communication in
error please contact Garyp@... <mailto:Garyp@...>
and delete this communication and any copies of it. Any views or
opinions presented are soley of those of the author and do not
necessarily represent those of Dot Net IT Limited.

Dot Net IT Limited, Reg No 4412519



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of dswmaom
Sent: 22 February 2010 22:35
To: vantage@yahoogroups.com
Subject: [Vantage] Printing Addresses





I am choking on a simple Crystal formatting issue having to do with
printing addresses. Vantage allows addr1,2,3 but some of our addresses
only use addr1. Some use addr1 and 2.

What I am wanting to do is to print only the non-blank addresses and
have the city-state-zip print below the address lines with no blank
lines.

I have a formula field setup as follows:

{ShipHead.shipToName}+ chr(13) +
If {ShipHead.shipToAddr1}<>"" Then{ShipHead.shipToAddr1}+ chr(13) +
If{ShipHead.shipToAddr2}<>"" Then{ShipHead.shipToAddr2}+ chr(13) +
If {ShipHead.shipToAddr3}<>"" Then{ShipHead.shipToAddr3}+ chr(13) +
If {ShipHead.shipToCity}<>"" Then{ShipHead.shipToCity}+",
"+{ShipHead.shipToState}+" "+{ShipHead.shipToZip}
Else ""

It prints:
name
addr1
addr2

but nothing else...
Apparently when it hits the blank addr3 it wigs out and doesn't print
the city-state-zip. I added the last "if" to check for a blank city not
because any of them would be blank, but in order to seperate it from the
"if" preceding it.

Any advice would be greatlyl appreciated.
Dale.





[Non-text portions of this message have been removed]