Default File Type
Hello,
I'm using Delphi 5 and RB 6.02:
I added DevExtras and can save to PDF format. Now, what I want to do is
set the default file format from Text to PDF File, after the user gets a
chance to preview the Output on the screen.
I can set the File Name with TppReport.TextFileName but I can't find
where to set the file format.
Thanks.
Skot.
I'm using Delphi 5 and RB 6.02:
I added DevExtras and can save to PDF format. Now, what I want to do is
set the default file format from Text to PDF File, after the user gets a
chance to preview the Output on the screen.
I can set the File Name with TppReport.TextFileName but I can't find
where to set the file format.
Thanks.
Skot.
This discussion has been closed.
Comments
You can set the file format you need using the Report.DeviceType property.
If you are using TExtraDev to print in PDF, I believe you want to set your
device to 'PDFFile'. Be sure to set the Report.AllowPrintToFile property to
True.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
If I do that then they can't preveiw the report, on screen, it goes to
the file.
When the printer dialogue comes up, there is a dropdown for FileType as
well as an edit box for the FileName. I can set Filename OK, but not
the type, it goes to Text by default and I want it to default to PDFFile.
Sorry if I'm not too clear.
Skot.
Sorry, I didn't understand exactly what you were after the first time. You
are going to want to add the following lines to the Report.PrintDialogCreate
event to get the results you need. You can leave the default devicetype
setting to 'screen' if you do this.
procedure TForm.ReportPrintDialogCreate(Sender: TObject);
begin
Report.PrintDialog.DeviceType := 'PDFFile';
Report.PrintDialog.PrintToFile := True;
end;
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks Nico,
That's what I was missing: Report.PrintDialog
Cheers.
Skot.