How To Center Text
To center text in your reports, use the @=
symbol before and after the text that you want to center.
Remember to use [ < ] to remove trailing spaces from
the field that you are centering or they will be included.
For example:
@=de.na<@= will center the Debtor's name
and trim any blank spaces from the end of the name.
The @= symbol can only be used with
a SINGLE field or variable on a line.
To create a centered heading for a letter, for instance, you would
use variables to "build" the items in your heading.
Using Variables To Center A Heading
To use more than one field or textual item in each line of your
heading, it is necessary to use variables. You need a variable
for each item of information and a variable that combines these
items into each line of your heading.
Let's say that you are creating a centered heading that contains
your company name, address, city, state, zip code, phone and
fax. You would like it to be centered, as illustrated.
Company Name
Street Number and Address
City, State, Zip Code
Phone: Phone Number Fax: Fax Number
This requires the following steps:
You have to be familiar with the use of variables
and math with database fields to perform these steps.
1. Create these variables for the parts of your heading that
require more than one reference on a line.
@varPhone* = "Phone: "
@varFax* = " Fax: "
@varPhoneLine* = @(varPhone+cd.ph+varFax+cd.fa)
Remember that the [ * ] symbol indicates that you are
creating a variable to hold a string. In this instance, we are declaring
and initializing the variables in the same step.
This code creates variables to handle text and spacing. Then a
new variable holds all the information for one line. Since the
other lines of the Company information are taken from the
Company Details form, each line is only one reference to a
single field.
2. Create the heading, using the field codes and the variable.
@cd.na
@cd.ad
@cd.ad2
@varPhoneLine
3. Use the @= symbol to center your heading.
@=@cd.na<@=
@=@cd.ad<@=
@=@cd.ad2<@=
@=@varPhoneLine@=
It is not necessary to trim spaces from the variable since
Collect! does this automatically when you build the @varPhoneLine variable.
See Also
- How To Use Math With Database Fields
- How To Use Variables
- Report Topics Index for a list of all report and letter topics
- Report Sample to view sample reports and letters
|
Was this page helpful? Do you have any comments on this document? Can we make it better? If so how may we improve this page.
Please click this link to send us your comments: helpinfo@collect.org