printing to pdf file
Hi,
I'm using ReportBuilder to print from my application. Now I want also to
print to a pdf file.
I did think that the following code should do the trick:
ppViewer.Report.ShowPrintDialog := True;
ppViewer.Report.AllowPrintToFile := True;
ppViewer.Report.DeviceType := 'PDFFile';
ppViewer.Report.TextFileName := '';
ppViewer.Report.Print;
But I get a preview screen popup! But when I don't use this code evreything
will be correctly printed on the printer. Am I forgetting something?
I'm using Delphi 5 with ReportBuilder 7.01 Enterprise.
Thanks in advance and best regards,
Mischa E.J. Hoogendoorn
I'm using ReportBuilder to print from my application. Now I want also to
print to a pdf file.
I did think that the following code should do the trick:
ppViewer.Report.ShowPrintDialog := True;
ppViewer.Report.AllowPrintToFile := True;
ppViewer.Report.DeviceType := 'PDFFile';
ppViewer.Report.TextFileName := '';
ppViewer.Report.Print;
But I get a preview screen popup! But when I don't use this code evreything
will be correctly printed on the printer. Am I forgetting something?
I'm using Delphi 5 with ReportBuilder 7.01 Enterprise.
Thanks in advance and best regards,
Mischa E.J. Hoogendoorn
This discussion has been closed.
Comments
to the device that you have selected in the Report.DeviceType property. Try
calling Report.Print instead of Viewer.Report.Print.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
I did give it a try, but it just doesn't work.
I will descripe the situation for you:
I have a mainform where all reports are presented in a viewer. This works.
Now there are 2 buttons on the form. One to print, with the code:
ppViewer.Print;
This works just fine.
Now I have a second procedure (buttonclick):
procedure TfrmMain.sbtnPrintTofileClick(Sender: TObject);
begin
DmMain.ppReport.ShowPrintDialog := True;
DmMain.ppReport.AllowPrintToFile := True;
DmMain.ppReport.DeviceType := 'PDFFile';
DmMain.ppReport.TextFileName := '';
DmMain.ppReport.DeviceType := 'PDFFile';
DmMain.ppReport.Print;
end;
This seems like you told me. The report I am referring to is connected with
the viewer component. But when I run this, I will get a popup screen that is
called: Print Preview. This is a standard screen and actually displaying
what I see in my mainform on the viewer component.
I have also tryed to delete the upper 4 lines in this procedure, but no
difference is found.
I'm out of options here. Do you have some idea's?
Thanks in advance and best regards,
Mischa E.J. Hoogendoorn
you are using? Is a template being loaded? Can you recreate this in a simple
example and send it to us at support@digital-metaphors.com I'll be happy to
take a look at in the debugger.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com