Label not printing but shows in Print Preview
I have a couple of TppLabels on a report and, when I print the report to the
screen (i.e. PREVIEW), all looks as it should with both labels visible and
containing exact values I would expect them to. However, when I click on the
print button (within the standard PREVIEW form), one of the labels does not
print. What could be causing this?
NOTE: I am using Delphi 6 and RB 6.03.
screen (i.e. PREVIEW), all looks as it should with both labels visible and
containing exact values I would expect them to. However, when I click on the
print button (within the standard PREVIEW form), one of the labels does not
print. What could be causing this?
NOTE: I am using Delphi 6 and RB 6.03.
This discussion has been closed.
Comments
This behavior could be caused by a number of things. What type of printer
are you using? Here are a few things to try...
- Be sure you are printing within the printable area of your specific
printer, you may need to move the margins in to do so.
- Try setting Transparancy to False on your Labels. Some printers cannot
handle transparent objects.
- Be sure you are using the latest printer driver for your printer.
- As a test, comment out all your event handlers so no code is being
executed during report generation. If this solves the problem, gradually
begin adding them back to isolate the problem code.
- Try printing to a different printer and see if the results are the same.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
HP Laserjet 1200, HP Laserjet 1500L, and HP OfficeJet 6110xi. Results are
the same on all three. The label that is not printing is clearly within
printable area of printer as it is near center of page. I am using latest
printer drivers on most, if not all printers.
All labels had transparency set to true (both those that printed fine and
one that didn't). I tried setting to False for the problematic one to no
avail...same problem.
I will try commenting out code and see what happens.
Take the value of the Height property for a label that prints. Check this
against the Height of the label that does not print. My guess is that the
label that does not print is smaller. Change the Height value to the value
of the one that works and try printing again...Viola!
Regards,
Chuck Van Acker
Alogent Corp.
was code that was setting the Top property of the label to 15 (calculated).
As a result, it must have ended up off the page (8.5 x 11 in sheet). What I
don't understand is why the label appears just fine in the print preview.
Any ideas?
-----------------------------------------------------
Article: Why Preview may not Match Printed Output
-----------------------------------------------------
ReportBuilder uses the Printer device context to perform all calculations
required to generate the report pages. This includes measuring text,
wrapping text, and calculating the vertical page space required by a
stretchable component such as a memo.
Using the Printer device context results in a very high degree of accuracy
when printing to the printer. For report Preview, all page elements must be
scaled back to the screen. A typical printer has a resolution of 600 pixels
per inch (or more). A typical screen has 96 pixels per inch. Thus there is
some loss of fidelity in rendering to the screen.
For multi-line text such as memos, ReportBuilder sometimes shrinks the font
size for the preview so that the rendered text can fit within the required
vertical page space. Even when True Type fonts this is sometimes necessary.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com