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

Printer Dialog

edited August 2007 in General
RB10Pro, D7.
I'm wanting to produce PDF files from the printer dialog.
When I check 'Print to File' on the Printer Dialog is there any way I
can force 'Type' to be PDF only or at least default 'Type' to PDF.
In addition, are there any events I can hook into to change the file
extension in the 'Where' box in reaction to changes in 'Type'.

Comments

  • edited August 2007
    I should add that I want to do this after starting off with a
    conventional preview, ie devicetype = 'screen'.

  • edited August 2007
    Hi Tony,

    You can override the OnClick event of the print button in the preview window
    to assign the device type and print the report to the device you need. For
    instance...

    uses
    ppPrvDlg;
    ...

    procedure TForm1.ppReport1PreviewFormCreate(Sender: TObject);
    begin
    TppPrintPreview(ppReport1.PreviewForm).PrintButton.OnClick :=
    PrintButtonClick;

    end;

    procedure TForm1.PrintButtonClick(Sender: TObject);
    begin
    ppReport1.DeviceType := 'PDF';
    ppReport1.Print;

    end;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2007
    Great thanks Nica i'll check it out
This discussion has been closed.