From: [email protected] [mailto:[email protected]] On Behalf Of Matthew
Burke
Sent: Friday, December 26, 2008 12:29 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Formatting labels

Matthew,

I use a stored procedure to format my customer addresses.  In the example
below, the address contains up to four lines.  When I want to format the
customer address on a form, report or label I call the following procedure
and it formats the address for me.  If there is a blank line in vCU_
ADD_LINE3,  it strips it out.  You could easily expand this process to
include more lines. 

 

First create a stored procedure.

To use the stored procedure you would first set the variable vCN with the
customer number, then....

CALL CUSTOMER_ADDRESS () 

 

The CALL command will cause the stored procedure (below) to execute.  The
variables VAR vCU_ADD_LINE1-4 will contain the formatted address.  You can
then use this same procedure anywhere in your application.

 

-- CONSTRUCT CUSTOMER ADDRESS (Stored procedure)

--vCN is the variable that contains the unique customer number

SET VAR vCU_ADD_LINE1 TEXT = (Fname&MidName&Lname) IN CUSTOMER +

WHE CUST# = .vCN

SET VAR vCU_ADD_LINE2 TEXT = STadd IN CUSTOMER WHE CUST# = .vCN

SET VAR vCU_ADD_LINE3 TEXT = STadd2 IN CUSTOMER WHE CUST# = .vCN

SET VAR vCU_ADD_LINE4 TEXT = (City+','&State&ZipCode) IN CUSTOMER +

WHE CUST# = .vCN

IF vCU_ADD_LINE3 IS NULL THEN

   SET VAR vCU_ADD_LINE3 = .vCU_ADD_LINE4

   SET VAR vCU_ADD_LINE4 = NULL

ENDIF

RETURN

 

 

I need to create some mailing labels and I can't figure out how to keep the
data merged together on the individual labels.  What I'm trying to do may be
better explained by example.

 

The table storing the customer data has fields like name1, name2, name3,
address1, and address2.

 

Customer1 has:

Name1: Bob

Name2: Some Business

Name3: Some Department

Address1: 1234 Number Lane

Address2: STE 1

 

Customer2 has:

Name1: Joe

Name2:

Name3:

Address1: 5678 Number Drive

Address2:

Address3:

 

To get all of customer1's information on a label, I of course have to
include all five fields.

My dilemma is that I do not want customer2's information to print as:

-------------------------------

Joe

 

 

5678 Number Drive

 

-------------------------------

 

But instead I want it to print as:

-------------------------------

Joe

5678 Number Drive

-------------------------------

 

 

I hope this makes sense. J

 

Matthew Burke

Pioneer Bank - IT Department

Computer Systems Technician

505-627-4415

 

Reply via email to