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

TppArchiveReader.Print

edited March 2005 in General
We use Delphi5 and Report Builder 7.04

I use TppArchiveReader.Print method inside a Windows Service Application.

It works perfect when I print RAF to PDF.

But when I print RAF to a printer, application freezes when the
TppArchiveReader.Print method is called.

Comments

  • edited March 2005
    Hi Misha,

    Try setting your library path to \RBuilder\Source and stop the execution of
    your app when it freezes up. This should show you where in the RB code (or
    other code) the problem is occuring. Let me know what you find.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2005
    Hi Nico,
    Program frezees in ppPrintr unit, TppCustomPrinter.EndDoc method on the
    following line:
    if not FAborted then
    Windows.EndDoc(FDC);
    I have already sent my application example to support@digital-metaphors.com
    a couple of days ago.
    I appreciate your help.


    procedure TppCustomPrinter.EndDoc;
    begin
    {$IFDEF CodeSite}
    gCodeSite.EnterMethod('TppCustomPrinter.EndDoc');
    {$ENDIF}

    if (Aborted) then
    exit;

    FLock.Acquire;

    {$IFDEF CodeSite}
    gCodeSite.SendString('TppCustomPrinter.EndDoc', 'Lock acquired');
    {$ENDIF}

    try

    if not FPrinting then Exit;

    EndPage;

    {$IFDEF CodeSite}
    gCodeSite.SendString('TppCustomPrinter.EndDoc', 'EndPage');
    {$ENDIF}


    if not FAborted then
    Windows.EndDoc(FDC);

    {$IFDEF CodeSite}
    gCodeSite.SendString('TppCustomPrinter.EndDoc', 'Windows.EndDoc(FDC)');
    {$ENDIF}

    FreeDC;

    {$IFDEF CodeSite}
    gCodeSite.SendString('TppCustomPrinter.EndDoc', 'FreeDC');
    {$ENDIF}

    FPrinting := False;
    FStartPage := False;
    FAborted := False;
    FPageNumber := 0;

    finally
    FLock.Release;
    end;

    {$IFDEF CodeSite}
    gCodeSite.ExitMethod('TppCustomPrinter.EndDoc');
    {$ENDIF}

    end; {procedure, EndDoc}

  • edited March 2005
    Nico,

    This is looks like the common Windows Service problem.
    The main problem you will encounter printing from a service is that services
    usually run under the localsystem account which only has access to resources
    on the local system. As this account is separate from the account you login
    under it is also unaware of any network printer connections you have setup.

    In my service applicatrion I tried to print to the network printer.

    Thanks,
    Misha.

This discussion has been closed.