Print dialog - "Browse" Button Does not work
I am using the following procedure to print reports in a PDF format using
ExtraDevices. However, the "Browse" button next to the edit box of the
TextFile does not work.
Is there a property setting that I missed or is this a bug? I am using
ReportBuilder Standard Edition Version 6.03.
Here's the code:
procedure TfrmReport.SaveReportAsPDF(Report: TppReport; FileName: string);
begin
DisableControls;
try
with Report do begin
DeviceType := 'PDFFile';
AllowPrintToFile := True;
ShowPrintDialog := True;
TextFileName := PDFReportPath + FileName;
Print;
end; { with }
finally
EnableControls;
end; { try/finally }
end; { SaveReportAsPDF }
ExtraDevices. However, the "Browse" button next to the edit box of the
TextFile does not work.
Is there a property setting that I missed or is this a bug? I am using
ReportBuilder Standard Edition Version 6.03.
Here's the code:
procedure TfrmReport.SaveReportAsPDF(Report: TppReport; FileName: string);
begin
DisableControls;
try
with Report do begin
DeviceType := 'PDFFile';
AllowPrintToFile := True;
ShowPrintDialog := True;
TextFileName := PDFReportPath + FileName;
Print;
end; { with }
finally
EnableControls;
end; { try/finally }
end; { SaveReportAsPDF }
This discussion has been closed.
Comments
behavior before. Can you create a simple project that reproduces the
problem? Try to reproduce it using RB 7.01 to see if the problem goes away.
I tested ExtraDevices PDF in RB 7.01, and it allows browsing of the file
with no problems.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Thanks for the quick reply.
I did some experimentation. The cause of the problem is that when the
TextFileName is set, the button is disabled; otherwise, it works.
I may try to work around this with my client. If I cannot, I will write
again.
Thanks again for the assistance and support.
Wayne McKittrick
tests today, I have set the text file name and use the PDF device, and the
browse button is enabled. I'm not able to reproduce the problem and it is
not a known issue. However, you can replace any form in RB. You can register
a custom print dialog. You can copy the current print dialog in ppPDlg.pas
and create a new one that doesn't disable the button in your version of RB,
perhaps you have modified the source before? There is a print dialog
replacement demo in the main report demo project. The report is #121.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Take care.
Wayne McKittrick