home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Press 1997 July
/
Sezamfile97_1.iso
/
msdos
/
database
/
pdx_ti2.arj
/
TI852.ASC
< prev
next >
Wrap
Text File
|
1993-02-23
|
17KB
|
529 lines
PRODUCT : Paradox NUMBER : 852
VERSION : All
OS : DOS
DATE : February 23, 1993 PAGE : 1/8
TITLE : Styling Paradox Reports and Mailing Labels
The styling of printed text is usually controlled through the use
of setup strings. In many software programs this styling is
handled by a printer driver which translates your software
requests for bolding, underlining or a special font, into setup
strings that the selected printer can understand.
For instance, your word processor may allow you to highlight a
region of text and assign a styling attribute to that region
through a menu command. This menu command then places special
hidden characters (referred to as control characters) around the
text. These special characters are then translated into setup
strings by the printer driver at the time of printing.
Paradox is different from these types of programs. Rather than
using menu-driven styling commands and hidden control characters
Paradox allows you to enter the setup string directly into a
report specification. There are no printer drivers and therefore
no translation is performed at the time of printing. This
approach may seem intimidating at first, because you must obtain
the necessary setup strings from the printer documentation and
know how to enter these strings correctly. Once the process is
mastered, however, you will gain access to most of the styling
capabilities that your printer has to offer. Describing this
process, is the purpose of this Technical Information Sheet.
The following section is a step-by-step explanation of the
process of placing setup strings into calculated fields in order
to style reports.
1. You may initially choose a global setup string for the
report through the report menu choices Settings | Setups.
At this time you may choose Custom and enter your own
custom string or choose Predefined and choose from a list
of predefined setup strings. If you wish to view the
current global setup string, choose Custom at this
juncture. Press <Enter> to accept the current printer
port, and you will see the current global setup string.
You may modify the setup string at this time.
2. Prior to performing any styling it is preferable to do all
other regular report customization. It is far easier to
place the styling setup strings last than to adjust them
as you design the report specification.
PRODUCT : Paradox NUMBER : 852
VERSION : All
OS : DOS
DATE : February 23, 1993 PAGE : 2/8
TITLE : Styling Paradox Reports and Mailing Labels
3. Determine the appropriate setup string to perform the
formatting task and count the number of characters
contained in the string. All ASCII characters with
decimal value of 31 or lower must be represented in three
digit decimal number preceded with a backslash (see
Appendix C of the PAL User's Guide for a complete list of
the ASCII Character Set and their corresponding decimal
codes). For instance, the Escape character which has
ASCII decimal value of 27 would be represented as: \027.
This set of four characters counts as a single character
because Paradox will convert it into its single character
form when sending it to the printer. A typical setup
string which bolds text on an HP Laserjet II is
represented as: \027(s3B. This string has a character
count of 5.
4. Calculate the total number of setup string characters that
will be placed on each line of the Report Specification.
Make note of the highest number of setup string characters
on any one line. We will refer to this number as the
Margin Offset. Make sure you take into account all setup
strings on the line. If you turn bolding on and off on
the same line using the string noted above (and its
complement which reverses the attribute), the Margin
offset would be 10.
5. Increase the Page Width of the report specification to
accommodate the space required for the Margin Offset. For
instance, turning bolding on and off on the same line on a
Laserjet requires that the standard 80 character
portrait-mode Page Width be increased to 90. You can
change the Page Width from the menu with the commands:
Setting | Pagelayout | Width. This is a safety precaution
to keep the text of the report from being pushed into the
next page width. If your report is less than 80
characters wide, it is not necessary to perform this step.
6. Reports that have multiple page widths must be handled
very carefully. When you increase the Page Width from 80
to 90 in order to accommodate 10 characters of setup
string you may also be enveloping fields and text in the
first page width that actually belong to the next page
width. Since the printer can only print 80 characters on
PRODUCT : Paradox NUMBER : 852
VERSION : All
OS : DOS
DATE : February 23, 1993 PAGE : 3/8
TITLE : Styling Paradox Reports and Mailing Labels
a page, some text may "fall between the cracks" between
the first and second page widths. To prevent this, you
must move the text that was originally included in the
second page width over to the right so that it once again
begins just to the right of the vertical bar that defines
the right margin. If there are more than two page widths
in the report it may be necessary to adjust each and every
page width appropriately. The concept here is that if the
original right margin was 80 then each page width as
defined by the new margin setting can still only print the
first 80 characters of each page width. See Example 2
below for more details.
7. Be sure that you are currently running in Insert mode by
checking for the letters "ins" in the upper right corner
of the Report Design screen. If it is not on, turn it on
by pressing the Insert key.
8. Move the cursor to the position on the Report
Specification where you want to begin a styling attribute.
9. From the Report menu select Field | Place | Calculated.
You will be prompted for an expression. Type in the setup
string enclosed in double quotes. For instance:
"\027(s3B". Press <Enter> twice to accept the string and
place the field at the cursor location. You will be
prompted to format the display width of the calculated
field. Adjust the width to match the exact number of
characters in the setup string. Bolding would look like
this: AAAAAA.
General Notes:
The setup strings will take up space in the Report Specification
and displace text or fields on the lines which they are placed.
This displacement will not actually occur when the report is
printed. The spaces occupied by the setup strings will be "eaten
up" by the printer which interprets them as printing commands,
not literal characters to be printed. If all the above
instructions are followed, all text and fields in the report
specification should print in the same location as they appeared
before styling was added.
PRODUCT : Paradox NUMBER : 852
VERSION : All
OS : DOS
DATE : February 23, 1993 PAGE : 4/8
TITLE : Styling Paradox Reports and Mailing Labels
Paradox has no support for proportionally spaced fonts.
Activating these fonts may cause alignment problems, especially
if used in the table band in tabular reports. Use these fonts
only in areas where strict columner alignment is not required (as
in a title in the report or page header).
Notes on Mailing Labels:
Mailing labels are different from the typical report in that data
in the first page width is used as a template for all other page
widths in the report spec. Because the first page width can
effect the alignment of the subsequent page widths the Margin
Offset must be precise and the number of setup string characters
must be exactly the same on every line in the form band. This
insures that a fixed number of spaces will be "eaten up" on every
line and thus the page widths beyond the first will not have a
staggered left margin.
If you wish to style some lines of the label but not others, you
must place dummy setup strings on the lines that are not styled.
You can create a dummy setup string by turning off an attribute
immediately after turning it on.
Examples:
Example 1:
The following example is based on a mailing label report. It
will cover styling issues relevant to both normal reports and
reports in labels mode. The setup strings in this example are
appropriate for an HP Laserjet II.
For the purpose of clarity, we will use a letter key to identify
each field in the report specification. Your report
specification would not actually appear this way. This is the
key:
A's = First Name
B's = Last Name
C's = Street Address
D's = City
E's = State
F's = Zip Code
PRODUCT : Paradox NUMBER : 852
VERSION : All
OS : DOS
DATE : February 23, 1993 PAGE : 5/8
TITLE : Styling Paradox Reports and Mailing Labels
X's = a calculated field for bold type: "\027(s3B"
Y's = a calculated field for normal type: "\027(s0B"
Example 1a:
This is the mailing label report before styling:
....+...10....+...20....+...3*....+...10....+...20....+...3*....
page─────────────────────────┼─────────────────────────────┼─────
form─────────────────────────┼─────────────────────────────┼─────
AAAAAAAAAA BBBBBBBBBB │ │
CCCCCCCCCCCCCCCCCCCC │ │
DDDDDDDDDD, EE FFFFF │ │
form─────────────────────────┼─────────────────────────────┼─────
page─────────────────────────┼─────────────────────────────┼─────
═════════════════════════════╧═════════════════════════════╧═════
Example 1b:
This is the report after styling only the first line (note that
the right margin has been increased to 40 in order to accommodate
the Margin Offset.)
....+...10....+...20....+...30....+...4*....+...10....+...20...
page───────────────────────────────────┼───────────────────────
form───────────────────────────────────┼───────────────────────
XXXXXAAAAAAAAAA BBBBBBBBBBYYYYY │
CCCCCCCCCCCCCCCCCCCC │
DDDDDDDDDD, EE FFFFF │
form───────────────────────────────────┼───────────────────────
page───────────────────────────────────┼───────────────────────
═══════════════════════════════════════╧═══════════════════════
PRODUCT : Paradox NUMBER : 852
VERSION : All
OS : DOS
DATE : February 23, 1993 PAGE : 6/8
TITLE : Styling Paradox Reports and Mailing Labels
Note that the first line has 12 characters that will be absorbed
by the printer as print commands. This will cause the right
margin to return to 30 so that the next page width will print in
the correct location. The subsequent lines will have 12 extra
trailing spaces and will leave the margin at 40. This would be
fine if this were a standard report, but in labels mode it will
cause alignment problems. The labels would look like this on the
printed page:
John Jones Ed Smith
10 Jones Street 10 Smith St.
Jonestown, NJ 06060 Smithtown,..
Example 1c:
The example below displays a method which corrects this effect.
Each line beyond the first is padded with a set of dummy setup
strings. These strings will have no styling effect and will be
"eaten up" by the printer. This will pull the right margin back
to its correct position. Keep in mind that labels reports are
special in that they must contain exactly the same number of
setup string characters on every line of the report. This
padding technique is only necessary for mailing labels.
....+...10....+...20....+...30....+...4*....+...10....+...20...
page───────────────────────────────────┼───────────────────────
form───────────────────────────────────┼───────────────────────
XXXXXAAAAAAAAAA BBBBBBBBBBYYYYY │
XXXXXYYYYYCCCCCCCCCCCCCCCCCCCC │
XXXXXYYYYYDDDDDDDDDD, EE FFFFF │
form───────────────────────────────────┼───────────────────────
page───────────────────────────────────┼───────────────────────
═══════════════════════════════════════╧═══════════════════════
Example 2:
This example demonstrates proper text and field adjustment when
using setup strings for styling in a multiple page width report.
Different letters are once again used to differentiate between
different fields.
PRODUCT : Paradox NUMBER : 852
VERSION : All
OS : DOS
DATE : February 23, 1993 PAGE : 7/8
TITLE : Styling Paradox Reports and Mailing Labels
Example 2a:
This is a simple multiple page free form report before
modification.
....+...10....+...20....+...3*....+...10....+...20....+...3*....
Report Header Info │ Report Header Info
page─────────────────────────┼─────────────────────────────┼─────
form─────────────────────────┼─────────────────────────────┼─────
AAAAAAAAAA BBBBBBBBBB │CCCCCCCC DDDDDDDDDDDDDDDDD │
EEEEEEEEEEE FFFFFFFFFFFFF │GGGGGGGGGGGGGGGGGGGGGG │
form─────────────────────────┼─────────────────────────────┼─────
page─────────────────────────┼─────────────────────────────┼─────
═════════════════════════════╧═════════════════════════════╧═════
Example 2b:
This is the same report after the Page Width has been increased
to accommodate a five character margin offset. As you can see
fields C, D, and G now belong (partially) to the wrong page
width.
....+...10....+...20....+...30....*....+...10....+...20....+...30
Report Header Info Report Header Info
page──────────────────────────────┼──────────────────────────────
form──────────────────────────────┼──────────────────────────────
AAAAAAAAAA BBBBBBBBBB CCCCCCCC DDDDDDDDDDDDDDDDD
EEEEEEEEEEE FFFFFFFFFFFFF GGGGGGGGGGGGGGGGGGGGGG
form──────────────────────────────┼──────────────────────────────
page──────────────────────────────┼──────────────────────────────
══════════════════════════════════╧══════════════════════════════
PRODUCT : Paradox NUMBER : 852
VERSION : All
OS : DOS
DATE : February 23, 1993 PAGE : 8/8
TITLE : Styling Paradox Reports and Mailing Labels
Example 2c:
This is the same report after the fields and text have been moved
to accommodate the margin offset. No actual styling setup
strings have been placed yet.
....+...10....+...20....+...30....*....+...10....+...20....+...30
Report Header Info │ Report Header Info
page──────────────────────────────┼──────────────────────────────
form──────────────────────────────┼──────────────────────────────
AAAAAAAAAA BBBBBBBBBB │CCCCCCCC DDDDDDDDDDDDDDDDD
EEEEEEEEEEE FFFFFFFFFFFFF │GGGGGGGGGGGGGGGGGGGGGG
form──────────────────────────────┼──────────────────────────────
page──────────────────────────────┼──────────────────────────────
═════════════════════════════════════════════════════════════════
Once in this state it is important to maintain the field
positions as they appear. Inputting setup strings in one page
width will move the fields in the subsequent page widths to the
right. Restore them to their proper positions when this occurs.
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.