At 12:29 PM 12/26/2008, Matthew Burke wrote:
I need to create some mailing labels and I cant figure out how
to keep the data merged together on the individual labels. What
Im trying to do may be better explained by example
The table storing the customer data has fields like name1, name2,
name3, address1, and address2.
Matthew,
Here's an example that demonstrates the technique to concatenate
and merge the data as deemed necessary.
Example: (Based on RRBYW16 - To create Custom Mail Merge Letters)
Table: OrderSummary
Associated Columns:
. SFirstName (such as A.)
. SMiddleName (such as Razzak)
. SLastName (such as Memon)
. SCompany (such as R:BASE Technologies, Inc.)
. SAddress1 (such as 3935 Old William Penn Highway)
. SAddress2
. SCity (such as Murrysville)
. SState (such as PA)
. SZipCode (such as 15668-1854)
Using this example, the goal is to create a custom letter with
the following format:
Dear FirstName: OR Middle Name: (not just the initials)
Line1
Line2
Line3
Steps:
Define the following variables as expressions to be calculated
on [D] Detail Band:
vSFirstNameLength INTEGER = (SLEN(SFirstName))
vSMiddle TEXT = (vSMiddle)
vGreeting TEXT = ('Dear'&(IFGT(.vSFirstNameLength,2,SFirstName,SMiddle))+':')
Line1 TEXT = (SFirstName&SMiddle&SLastName)
Line2 TEXT = (IFEXISTS(SCompany,(SCompany+(CHAR(013))+ +
(IFEXISTS(SAddress2,(SAddress1+(CHAR(013))+ +
SAddress2),SAddress1))),(IFEXISTS(SAddress2,(SAddress1+ +
(CHAR(013))+SAddress2),SAddress1))))
-- take out the line continuation "+" when defining the
expression as one line in a Report/Label designer
Line3 TEXT = (SCity+','&SState&SZipCode)
Now to create a mail merge letter, using the "Rich Text" Object with
MailMerge option checked, place the following variables accordingly:
{Line1}
{Line1}
{Line1}
{vGreeting}
Type and format your text here while using the built-in Rich Text
Editor of R:BASE Report/Label designer.
The final letter should look like this:
----------
A. Razzak Memon
R:BASE Technologies, Inc.
3935 Old William Penn Highway
Murrysville, PA 15668-1854
Dear Razzak:
Your typed and formatted rich text here ...
----------
Take this practical example and recycle the technique as you wish.
Have fun!
Very Best R:egards,
Razzak.