Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Selecting printer from Print Dialog

edited April 2002 in General
Delphi 5 Pro Update pack 1
RB 5.56

I have workstations that require a printer driver for receipt printers (Star
thermal printers). These drivers *must* be set as the default printer
because I'm utilizing fonts internal to the printer to control things like
printing logos and opening cash drawers. If I try to print a normal report
(letter size, 8 1/2 x 11) to a network printer from these same workstations,
I get an endless supply of blank pages. I know blank pages can be the result
if paper form sizes are not equal, that is the paper form size I'm trying to
print does not match the paper form size of the printer selected. And that's
where my question is: If I change the printer in the Print Dialog form, why
does that not change the PrinterName value to the printer I selected - thus
changing the paper size? I put a stop on the OnPrintDialogClose event and
after I selected a printer other than the default, I looked at the values of
the PrinterSetup property. It still showed the PrinterName as "Default", not
the printer I just selected. The default printer is the receipt printer
which does not have the paper size I need - thus the endless supply of blank
pages.

I've reviewed the demo program dm0121. This demo has it's own print dialog
form so it can fire an event when the printer is changed. Should this happen
in the regular Print Dialog form? Or, Is there an event I can check when the
printer is changed in the printer dialog form? Or is there a better solution
for me?

Thanks, this is rather urgent.

mbd

Comments

  • edited April 2002
    Please upgrade to RB 6.03 which should, hopefully, solve the problem you are
    encountering. Contact info@digital-metaphors.com with your registration
    info.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited April 2002
    I upgraded to RB 6.03 and my problem is not resolved. But I have discovered
    some additional factors that may help. Again, my problem involves if my
    default printer is set to a receipt printer (in my case a Star TSP743) and I
    generate a regular letter size report in which I want to go to a different
    printer. If I choose a different printer in the PrintDialog form (a laser
    printer for example) I get an endless supply of blank pages. The new
    information I discovered is if I select the laser printer and then click on
    the properties button to show the Document Properties form and immediately
    close the form (or click around in there, it really doesn't matter), my
    report prints just fine (no blank pages). But I have to open the Document
    Properties form first. If I just select the new printer and do not open this
    form, I get blank pages.

    If you want to reproduce, it's very simple. You can get the Star TSP743
    driver from their web site (www.starmicronics.com). Set this driver as the
    default. I added two components to a new form, a TppReport and a TBitBtn. In
    the report designer I simply added a label to the detail band. In the
    OnClick event of the TBitBtn I called ppReport1.Print. That's it.

    Because of time constraints (actually, clients breathing down my neck) I
    need to figure out something quick. I'm hoping RB can come up with something
    simple because I have lots of reports that would need modifications if it
    comes down to programming an event.

    Thanks, look forward to hearing from you,

    mbd


    "Alexander Kramnik (Digital Metaphors)" wrote
  • edited April 2002
    I downloaded the TSP743 driver from Star and attempted to reproduce your
    problem by setting up two printers, with the one using the star driver set
    to default, and printing to a different printer. I didn't get the blank page
    behaviour you described. Please email support@digital-metaphors.com to
    request a patch for the printer unit as it incorporates fixes for a number
    of bugs including properly updating the papersize.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited April 2002
    That's promising that you did not have the problem. I emailed the request
    for the patch. I'll let you know how it goes. Thanks a bunch.

    mbd

    "Alexander Kramnik (Digital Metaphors)" wrote
  • edited April 2002
    The patch seems to fix my problem. Many, many thanks.

    mbd

This discussion has been closed.