Let me start by saying I am very green!! I took a 2 day beginner course in crystal reports via webinar. Now I am the company expert.....
I have a report that basically creates an invoice that was created by a long gone employee. The company is actually 3 companies with mutiple sites; 2 of these companies have a single billing address each easy peasy works great. The 3rd company has 2 billing addresses dependent upon the site. They now want the invoices to reflect this change. Right now it is using this code: which works but just 1 billing address per company.
// Don't show Country when in US.
//StringVar Address;
//If ToNumber(ADGclsADGCryFunctionsSOSetup ("PrtCpny")) = 1 Then
// Address := AddressLine1( ADGclsADGCryFunctionsSOSetup("Addr1"), ADGclsADGCryFunctionsSOSetup("Addr2") ,ADGclsADGCryFunctionsSOSetup("City") ,ADGclsADGCryFunctionsSOSetup("State") ,ADGclsADGCryFunctionsSOSetup("Zip") ,ADGclsADGCryFunctionsSOSetup("Country") );
// If Trim(Address) <> "US" and Trim(Address) <> "USA" then
// Address
//Else
// ""
If {SOShipHeader.CpnyID} = 'MDC' then
'P.O. Box 639'
Else
If {SOShipHeader.CpnyID} = 'RKY' then
'13027 County Rd. 18'
Else
If {SOShipHeader.CpnyID} = 'WST' then
'4975 W. Winnemucca Blvd.'
Else
""
So following the same logic I tried this and The report is blank and I am sad.
// Don't show Country when in US.
//StringVar Address;
//If ToNumber(ADGclsADGCryFunctionsSOSetup ("PrtCpny")) = 1 Then
// Address := AddressLine1( ADGclsADGCryFunctionsSOSetup("Addr1"), ADGclsADGCryFunctionsSOSetup("Addr2") ,ADGclsADGCryFunctionsSOSetup("City") ,ADGclsADGCryFunctionsSOSetup("State") ,ADGclsADGCryFunctionsSOSetup("Zip") ,ADGclsADGCryFunctionsSOSetup("Country") );
// If Trim(Address) <> "US" and Trim(Address) <> "USA" then
// Address
//Else
// ""
If{SOShipHeader.CpnyID}='MDC'and{SOShipHeader.SiteID}='MDCDALGNRL'then
'P.O. Box 784'
Else
If{SOShipHeader.CpnyID}='MDC'and{SOShipHeader.SiteID}='MDCHERGNRL'then
'P.O. Box 784'
Else
If{SOShipHeader.CpnyID}='MDC'and{SOShipHeader.SiteID}='MDCSUNGNRL'then
'P.O. Box 784'
Else
If {SOShipHeader.CpnyID} = 'MDC' then
'P.O. Box 639'
Else
If {SOShipHeader.CpnyID} = 'RKY' then
'13027 County Rd. 18'
Else
If {SOShipHeader.CpnyID} = 'WST' then
'4975 W. Winnemucca Blvd.'
Else
""
I then try the below with the same result.
// Don't show Country when in US.
//StringVar Address;
//If ToNumber(ADGclsADGCryFunctionsSOSetup ("PrtCpny")) = 1 Then
// Address := AddressLine1( ADGclsADGCryFunctionsSOSetup("Addr1"), ADGclsADGCryFunctionsSOSetup("Addr2") ,ADGclsADGCryFunctionsSOSetup("City") ,ADGclsADGCryFunctionsSOSetup("State") ,ADGclsADGCryFunctionsSOSetup("Zip") ,ADGclsADGCryFunctionsSOSetup("Country") );
// If Trim(Address) <> "US" and Trim(Address) <> "USA" then
// Address
//Else
// ""
if {SOShipHeader.SiteID} = 'MDCGCKLCAG' then 'P.O. Box 639'; if {SOShipHeader.SiteID} = 'MDCGCKSHOP' then 'P.O. Box 639'; if {SOShipHeader.SiteID} = 'MDCGCKTRUK' then 'P.O. Box 639';
if {SOShipHeader.SiteID} = 'MDCGCKUCAG' then 'P.O. Box 639';if {SOShipHeader.SiteID} = 'MDCGCKYRDC' then 'P.O. Box 639'; if {SOShipHeader.SiteID} = 'MDCGCKYRDE' then 'P.O. Box 639';
if {SOShipHeader.SiteID} = 'MDCGCKYRDW' then 'P.O. Box 639'; if {SOShipHeader.SiteID} = 'MDCHCMGNRL' then 'P.O. Box 639';
if {SOShipHeader.SiteID} = 'MDCDALGNRL' then 'P.O. Box 784'; if {SOShipHeader.SiteID} = 'MDCHERGNRL' then 'P.O. Box 784'; if {SOShipHeader.SiteID} = 'MDCSUNGNRL' then 'P.O. Box 784';
if {SOShipHeader.SiteID} = 'WSTRENGRL' then '4975 W. Winnemucca Blvd.'; if {SOShipHeader.SiteID} = 'WSTWINGRL' then '4975 W. Winnemucca Blvd.'; if {SOShipHeader.SiteID} = 'WSTBFLGNRL' then '4975 W. Winnemucca Blvd.';
if {SOShipHeader.SiteID} = 'RKYFTLDRLS' then '13027 County Rd. 18'; if {SOShipHeader.SiteID} = 'RKYFTLFLDS' then '13027 County Rd. 18';
if {SOShipHeader.SiteID} = 'RKYFTLSHOP' then '13027 County Rd. 18'; if {SOShipHeader.SiteID} = 'RKYFTLYARD' then '13027 County Rd. 18';if {SOShipHeader.SiteID} = 'RKYFTLYRDN' then '13027 County Rd. 18';
if {SOShipHeader.SiteID} = 'RKYFTLYRDS' then '13027 County Rd. 18' else
I have a report that basically creates an invoice that was created by a long gone employee. The company is actually 3 companies with mutiple sites; 2 of these companies have a single billing address each easy peasy works great. The 3rd company has 2 billing addresses dependent upon the site. They now want the invoices to reflect this change. Right now it is using this code: which works but just 1 billing address per company.
// Don't show Country when in US.
//StringVar Address;
//If ToNumber(ADGclsADGCryFunctionsSOSetup ("PrtCpny")) = 1 Then
// Address := AddressLine1( ADGclsADGCryFunctionsSOSetup("Addr1"), ADGclsADGCryFunctionsSOSetup("Addr2") ,ADGclsADGCryFunctionsSOSetup("City") ,ADGclsADGCryFunctionsSOSetup("State") ,ADGclsADGCryFunctionsSOSetup("Zip") ,ADGclsADGCryFunctionsSOSetup("Country") );
// If Trim(Address) <> "US" and Trim(Address) <> "USA" then
// Address
//Else
// ""
If {SOShipHeader.CpnyID} = 'MDC' then
'P.O. Box 639'
Else
If {SOShipHeader.CpnyID} = 'RKY' then
'13027 County Rd. 18'
Else
If {SOShipHeader.CpnyID} = 'WST' then
'4975 W. Winnemucca Blvd.'
Else
""
So following the same logic I tried this and The report is blank and I am sad.
// Don't show Country when in US.
//StringVar Address;
//If ToNumber(ADGclsADGCryFunctionsSOSetup ("PrtCpny")) = 1 Then
// Address := AddressLine1( ADGclsADGCryFunctionsSOSetup("Addr1"), ADGclsADGCryFunctionsSOSetup("Addr2") ,ADGclsADGCryFunctionsSOSetup("City") ,ADGclsADGCryFunctionsSOSetup("State") ,ADGclsADGCryFunctionsSOSetup("Zip") ,ADGclsADGCryFunctionsSOSetup("Country") );
// If Trim(Address) <> "US" and Trim(Address) <> "USA" then
// Address
//Else
// ""
If{SOShipHeader.CpnyID}='MDC'and{SOShipHeader.SiteID}='MDCDALGNRL'then
'P.O. Box 784'
Else
If{SOShipHeader.CpnyID}='MDC'and{SOShipHeader.SiteID}='MDCHERGNRL'then
'P.O. Box 784'
Else
If{SOShipHeader.CpnyID}='MDC'and{SOShipHeader.SiteID}='MDCSUNGNRL'then
'P.O. Box 784'
Else
If {SOShipHeader.CpnyID} = 'MDC' then
'P.O. Box 639'
Else
If {SOShipHeader.CpnyID} = 'RKY' then
'13027 County Rd. 18'
Else
If {SOShipHeader.CpnyID} = 'WST' then
'4975 W. Winnemucca Blvd.'
Else
""
I then try the below with the same result.
// Don't show Country when in US.
//StringVar Address;
//If ToNumber(ADGclsADGCryFunctionsSOSetup ("PrtCpny")) = 1 Then
// Address := AddressLine1( ADGclsADGCryFunctionsSOSetup("Addr1"), ADGclsADGCryFunctionsSOSetup("Addr2") ,ADGclsADGCryFunctionsSOSetup("City") ,ADGclsADGCryFunctionsSOSetup("State") ,ADGclsADGCryFunctionsSOSetup("Zip") ,ADGclsADGCryFunctionsSOSetup("Country") );
// If Trim(Address) <> "US" and Trim(Address) <> "USA" then
// Address
//Else
// ""
if {SOShipHeader.SiteID} = 'MDCGCKLCAG' then 'P.O. Box 639'; if {SOShipHeader.SiteID} = 'MDCGCKSHOP' then 'P.O. Box 639'; if {SOShipHeader.SiteID} = 'MDCGCKTRUK' then 'P.O. Box 639';
if {SOShipHeader.SiteID} = 'MDCGCKUCAG' then 'P.O. Box 639';if {SOShipHeader.SiteID} = 'MDCGCKYRDC' then 'P.O. Box 639'; if {SOShipHeader.SiteID} = 'MDCGCKYRDE' then 'P.O. Box 639';
if {SOShipHeader.SiteID} = 'MDCGCKYRDW' then 'P.O. Box 639'; if {SOShipHeader.SiteID} = 'MDCHCMGNRL' then 'P.O. Box 639';
if {SOShipHeader.SiteID} = 'MDCDALGNRL' then 'P.O. Box 784'; if {SOShipHeader.SiteID} = 'MDCHERGNRL' then 'P.O. Box 784'; if {SOShipHeader.SiteID} = 'MDCSUNGNRL' then 'P.O. Box 784';
if {SOShipHeader.SiteID} = 'WSTRENGRL' then '4975 W. Winnemucca Blvd.'; if {SOShipHeader.SiteID} = 'WSTWINGRL' then '4975 W. Winnemucca Blvd.'; if {SOShipHeader.SiteID} = 'WSTBFLGNRL' then '4975 W. Winnemucca Blvd.';
if {SOShipHeader.SiteID} = 'RKYFTLDRLS' then '13027 County Rd. 18'; if {SOShipHeader.SiteID} = 'RKYFTLFLDS' then '13027 County Rd. 18';
if {SOShipHeader.SiteID} = 'RKYFTLSHOP' then '13027 County Rd. 18'; if {SOShipHeader.SiteID} = 'RKYFTLYARD' then '13027 County Rd. 18';if {SOShipHeader.SiteID} = 'RKYFTLYRDN' then '13027 County Rd. 18';
if {SOShipHeader.SiteID} = 'RKYFTLYRDS' then '13027 County Rd. 18' else