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

Generic text driver ony prints after closing app

edited December 2005 in Devices
Hi,

I'm not sure if this is the right place to ask, but any pointers would
be enormously appreciated.

I'm having a weird problem that has me stumped. I'm sending a RB6.03
report to a TM-U220 serial printer using the Generic Text Driver. The
report was designed using the layout guidelines suggested (1/6
multiples and Courier New font) and actually the report prints fine
when it does print. The problem is that after a few times the report
has been printed (sometimes after 1 successful print and other times
after 7 or 8 successful prints), the printer will simply not print the
report: the report just remains in the spooler but it is not printed.
I then realized that when this happens, if I close the application the
printer will immediately start printing the report. It looks as if
the spooler is still waiting for the app to indicate that the job has
been completed and can be printed, and when the TppPrinter object is
released (I'm guessing here), the printer gets the message that the job
can be printed.

I also noticed that the last line of the report is never printed, and
it is then printed as the first line of the next report that is sent to
the printer.

The code I'm using to print the report doesn't use anything fancy:

ppReport.ShowAutoSearchDialog := False;
ppReport.DeviceType := dtPrinter;
ppReport.ShowPrintDialog := False;
ppReport.NoDataBehaviors := [ndBlankReport, ndMessageOnPage];
ppReport.Print;

Any ideas? Thanks in advance.


Best regards,

Arturo Monge
Syantech, Inc.

Comments

  • edited December 2005
    Hi Arturo,

    This is not a known issue with the printer device however there have been
    numerous fixes and enhancements to this object since RB 6.03. My first
    recommendation would be to download a trial version of RB 9.03 (RB 7.04 if
    you are using D5) and test with that. Next, you might try using the driver
    provided by the manufacturer of your printer rather than the generic text
    driver. Perhaps this is causing the problems.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2005
    Hi, Nico,

    Yes, I know... I've been wanting to upgrade to RB9.03 for quite a while
    now but we are already a bit late with the release of our software and
    can't spend the time yet to upgrade it and all the libraries (including
    RB) to D7 (not sure about D2006 yet), though I already have things
    pretty much set for the upgrade and it should be happenning in Jan.

    Still, I have to figure out this problem with what we have. Strange,
    because I've been using RB6.03 for years now and while I know it has
    its strange issues, I had never seen this problem. Oh, and it also
    happened with the printer's driver. Actually, that's why I moved to
    the generic text driver (which I never had to use before and we have
    many clients printing to Epson POS printers), to remove the possibility
    of a printer driver issue. In addition, it only happens with the
    invoice report, which is the only one that is printed every 4 to 15
    seconds. It also happens on two different printers (of the same model)
    attached to two different computers.

    I want to try a few workarounds while we upgrade to RB9.03. One of
    them will be using the text report device and then printing using
    TPrinter. Also, since closing the application allows the printer to
    start the print job, I wanted to try freeing the TppPrinter object and
    recreating it. However, I wanted to know a couple of things first: is
    it correct to assume that RB uses the TppPrinter object exclusively to
    do the actual printing? Also, is it safe to do this (free the
    TppPrinter) or should I take additional steps to make sure this doesn't
    break anything... The report is being loaded from the database on a
    form that is created everytime the invoice is printed. For example,

    frmEndUserReporting := TfrmEndUserReporting.Create(Self);
    try
    with frmEndUserReporting do
    begin
    ShowPrintDialog := FPreviewInvoices;
    PrintInvoice(FInvoiceReportName, FPreviewInvoices, vInvoice);
    end; { with }
    finally
    frmEndUserReporting.Free;
    end; { finally }


    Thanks in advance for any pointers to a possible workaround.

    --
    Best regards,

    Arturo Monge
    Syantech, Inc.



  • edited December 2005
    Go it working now...

    I tried refreshing RB's printer list (as that process destroys the
    global ppPrinter object) and that didn't work (same behaviour as
    before), but printing to a text file and sending it to the printer
    through the standard TPrinter object worked fine.

    Thanks anyway!

    --
    Best regards,

    Arturo Monge
    Syantech, Inc.
This discussion has been closed.