- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Address Block on CRW form from drop box udf
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-27-2011 08:14 AM
I have a drop down box that lists addresses in the SO header table. The address is in horizontal format (Name, Address, City State Zip) How can I get crystal reports to print the address in an address block format on the SO form.
Name
Address
City, State ZIp
I know I can use the carriage return feature but not sure how to segregate the lines.
Mas 4.50.01
Thanks.
Re: Address Block on CRW form from drop box udf
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-27-2011 08:28 AM
You'll want to create a formula like the following (from 4.30):
StringVar BillToName := "";
StringVar BillToAddress1 := "";
StringVar BillToAddress2 := "";
StringVar BillToAddress3 := "";
StringVar BillToCity := "";
StringVar BillToState := "";
StringVar BillToZIPCode := "";
StringVar CRMCompanyName := "";
if {SO_SalesOrderWrk.BillToName} <> "" then BillToName :=
{SO_SalesOrderWrk.BillToName} + chr(13) + chr(10);
if {SO_SalesOrderWrk.BillToAddress1} <> "" then BillToAddress1 :=
{SO_SalesOrderWrk.BillToAddress1} + chr(13) + chr(10);
if {SO_SalesOrderWrk.BillToAddress2} <> "" then BillToAddress2 :=
{SO_SalesOrderWrk.BillToAddress2} + chr(13) + chr(10);
if {SO_SalesOrderWrk.BillToAddress3} <> "" then BillToAddress3 :=
{SO_SalesOrderWrk.BillToAddress3} + chr(13) + chr(10);
if {SO_SalesOrderWrk.BillToCity} <> "" then BillToCity :=
{SO_SalesOrderWrk.BillToCity} + ", ";
if {SO_SalesOrderWrk.BillToState} <> "" then BillToState :=
{SO_SalesOrderWrk.BillToState} + " ";
if {SO_SalesOrderWrk.BillToZIPCode} <> "" then BillToZIPCode :=
{SO_SalesOrderWrk.BillToZIPCode};
//if {SO_SalesOrderWrk.CRMCompanyName} <> "" then CRMCompanyName = {SO_SalesOrderWrk.CRMCompanyName} _
//+ chr(13) + chr(10)
//if {SO_SalesOrderWrk.OrderType} = "P" then
// formula = CRMCompanyName + BillToAddress1 + BillToAddress2 + BillToAddress3 + BillToCity + _
// BillToState + BillToZIPCode
//else
// formula =
BillToName + BillToAddress1 + BillToAddress2 + BillToAddress3 + BillToCity + BillToState + BillToZIPCode
//end if
The lines that are commented out are for CRM installations. You may also want to use the trim() function to take out trailing spaces.
Steve
MAS200 V4.30.21


