|
|
How does PERKS print
Reports under the 'Text' mode?
|
|
Article
No |
Q0018 |
|
Version Applicability |
PERKS
2.45
and later |
|
Last Reviewed On |
July
03, 2000 |
SYMPTOM:
You have prepared a Report design. As
you know that this Report will typically be extracted on a Dot-Matrix Printer, therefore
you have set the 'Print' mode of the Report as 'Text'. The design, itself, appears well
aligned (vertically and horizontally). However, while printing, the System is not printing
in an 'aligned' manner, i.e., the System is skipping lines. This becomes
particularly worrying, if you are taking printouts on pre-printed stationary.
Here is a more elaborate
description of the observed behaviour. You have prepared a Payslip design, which prints
with 6 lines of gap between two Payslips, i.e., 6 lines of space is being skipped between
the details of two successive employees. However, your problem is that, after a particular
number of Payslips (say, 4) are being printed, i.e., after printing the details of four
employees with the standard gap of six lines, the System printed a 'non-standard' gap of
five lines.
Under such circumstances, the
pertinent question, which may arise is that, how can this problem be avoided, and why does
the System behave in such a peculiar manner.
CAUSE:
Underneath,
we explain how Reports are printed in the 'Text' mode.
Every
grid unit in PERKS corresponds to two pixels, 10 vertical grid units correspond to one
text line, and 5 horizontal grid units to one text character. So '5 x 10' is actually the
size of a character in Text' mode. The segment separators are 15 units wide. While
printing, PERKS uses the pixel position of an object, divides it by 20 (i.e., '10 x 2'
pixels, since the position is saved in pixels), rounds it off, and prints it at that
position. So, if we do not use 'snap to grid', then the objects might not be placed
at a pixel position, which is exactly divisible by '20'.
Let us generate
a Report containing the specifications as laid down below.
Grouping - none
Width of report header - 0
Width of report header bar - 15
Width of page header - 0
Width of page header bar - 15
Width of Detail segment - 3 lines = 30 units
In order to print the first line of the 'detail' segment properly, the top row for all the
objects on that line should be exactly '30'.
Now, if we place
an object at position '32' (which is slightly below the grid line), let us find out what
happens:
Record 1: (32/2)/10 = 16/10 = 1.6
=> 2 (rounded off)
Record 2: ((32+30)/2)/10 = 31/10 = 3.1 => 3 (rounded off)
Record 3: ((62+30)/2)/10 = 46/10 = 4.6 => 5 (rounded off)
For record #3, we have a one line extra skip, here. Thus, the System will print an extra
gap of 1 line while printing the details for the third employee.
Similar problems will occur, if the segment separators are not properly placed, or the
segment width are not proper.
RESOLUTION:
While designing
a 'text' type Report, take care to place all the text and data fields at the appropriate
row number (in pixels) so that after rounding off, no problems are encountered.
Please remember one more
point; if the current segment starts from half of a grid cell ('5 x 10'), please start the
line from there itself, and not from the beginning of the next line. To facilitate this,
PERKS allows snapping at half grid stops.
This Article clearly
demonstrates the use of 'gridline' and 'snap to grid' options.
In order to ensure that
fields are placed at proper positions, grid scale should be set to '5 x 10' (height: 10
pixels and width: 5 pixels), and 'snap' should be 'ON'. Besides, if required, we can use
the 'Show Gridlines' feature.
Further, as indicated above,
while computing the line number, PERKS considers the height of a character as 10 pixels.
Hence, font size should be '10', normal (i.e., 'Regular'). To print Bold letters, the same
field can be pasted twice, one exactly on top of another. Besides, the 'Courier New' font
should be used since it is not possible to support font styles under printing in 'Text'
mode.Although, the Font dialog is available, only 'Courier New' matches
with the 'Text' mode default font style.
Moreover, with 'Text' mode
designs, 'spooling' a Report (and, sending the spooled file to the Printer from an Editor,
or to the 'Command' prompt) rather than taking a printout directly on the Printer, always,
proves to be a wise decision.
MORE INFORMATION:
Refer to the Article titled
Difference between 'Spool To' and
'Output To'
|
|