Home Server

Generate pdf file fail

edited April 2003 in Server
I have a ppreport in a Isapi dll.

When i try to use print methode of ppreport i have this message
"Screen printer does not support printing. "

the printer is adobe pdf writer.

I have all my ppreport showdialog options to false

Can you help me to resolve this problem.

In debug mode all works fine.

Comments

  • edited April 2003

    If you are printing to a file, you should never receive this error. This
    error is raised in the case which the report is being printed to the
    printer, and there is no printer driver available. ReportBuilder has the
    ability to use a virtual 'screen' printer. (See
    Report.PrinterSetup.PrinterName in the object inspector).

    This error is raised in RBuilder\Source\ppPrintr.pas. Search for the method
    called TppCustomPrinter.GetDC. You will notice there is a check for
    FPrinting. FPrinting is set to true when Printer.BeginDoc is called to a
    start a print job for the printer.

    Try running your code in a WebDebugger application so that you can trace it.


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2003

    1. You need to set Report.DeviceType to the name of the PDF device that you
    are using. At Delphi design-time, these names are listed in the
    Report.DeviceType property editor drop down that is displayed by the object
    inspector.

    Exampe for Pragnaan PDF:

    Report.DeviceType := 'Adobe Acrobat Document';


    2. From looking at your code, I think you also need to set
    Report.ShowCancelDialog to False.



    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2003
    thank you for your response
    With WebDebugger all work fine.
    I dont understand what appen with IIS.
    The only difference is that my developpment machine is win NT and the IIS is
    WINDOWS 2000 SERVER.
    Do you know if is difference between this 2 systems.

    Look my code is it correct ?
    ppReport1.template.FileName := qualifyfilename('Etats\' + Etat +
    '.rtm');
    ppReport1.template.loadfromfile;
    ppreport1.DeviceType := dtPrinter;
    ppreport1.PrinterSetup.PrinterName :='SIRH';
    ppReport1.PrinterSetup.DocumentName := Webcontext.Session.SessionID +
    '_' + etat;
    ppReport1.ShowPrintDialog := false;
    ppReport1.print;


  • edited April 2003
    I don't use any addon. I only use RBUILDER and ppreport.
    I have a PDF printer installed on my server (Acrobat writer). If i print
    file on this printer this printer make a pdf file with the input file.
    I have only 5 devices in devicetype propertie (archivefile,printer,screen,
    xhtml,textfile)
    i think the appropriate devicetype is printer.
    this method work fine in debug mode.

    thank for your time






  • edited April 2003

    When the Web application executes as an ISAPI .DLL under IIS, it will be
    executing under a different user account.

    There are two user accounts created by IIS: IUSR_MachineName and
    IWAM_MachineName. (MachineName is replaced by the name of your computer).
    The IWAM_MachineName account is a user account that IIS uses to run web
    applications such as the web tier.

    On the IIS server machine, you will need to install the acrobat printer
    driver in such a way that it is available to the IWAM_MachineName account. I
    think this requires that you log in to Windows as IWAM_MachineName and
    install the printer driver.


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.