PrintDialog - Print to File - FileFilter
Hi,
I am trying to do the following: in Print Dialog when Print to File checked
allow the user to select only csv files (or make default extension .csv).
In Report.PrintDialogCreate I have
Report.PrintDialog.FileFilter := 'CSV files|*.CSV';
Report.PrintDialog.DefaultFileExt := '.csv';
But this doesn't work, default extension and filter still .txt.
Could someone help please.
Thanks.
Inna.
I am trying to do the following: in Print Dialog when Print to File checked
allow the user to select only csv files (or make default extension .csv).
In Report.PrintDialogCreate I have
Report.PrintDialog.FileFilter := 'CSV files|*.CSV';
Report.PrintDialog.DefaultFileExt := '.csv';
But this doesn't work, default extension and filter still .txt.
Could someone help please.
Thanks.
Inna.
This discussion has been closed.
Comments
can add these two lines to the print dialog code in ppPDlg.pas and rebuild
using RBuilder\Source directory instead of RBuilder\Lib to use these
changes.
procedure TppPrintDialog.btnPrintToFileClick(Sender: TObject);
begin
-->SaveDialog1.DefaultExt := DefaultFileExt;
-->SaveDialog1.Filter := FileFilter;
if SaveDialog1.Execute then
begin
edtPrintToFileName.Text := SaveDialog1.FileName;
UpdateFileName;
UpdateFileSettings;
end;
end; {procedure, btnPrintToFileClick}
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
I have another question though. Can I implement this using RAP? I'd like to
put this code in OnPrintDialogCreate:
Report.PrintDialog.FileFilter := 'CSV files|*.CSV';
Report.PrintDialog.DefaultFileExt := '.csv';
But I am getting an error: Line 3: Expected: '(' or '[', but found
'FileFilter' instead.
Thanks.
Inna.
create a pass-through function and pass the report as parameter. The error gets raised because there is RAP RTTI available for this specific property.
regards,
Chris Ueberall;
I meant there is no RAP RTTI available for this specific property.