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

Error after printing.

edited March 2003 in End User
Hi,

I've got the following problem:

When we have a report on screen and we print it. Everything works fine.
When we have a report on screen and we print it to file, than everything
works also right.

But when we print (to printer) and directly after this print to file, we get
the following error:

Unable to open file: .


The source:

PRINTING:

ppViewer1.Report.AllowPrintToFile := False;
ppViewer1.Report.TextFileName := '';
ppViewer1.Report.DeviceType := 'Printer';
ppViewer1.Report.ShowPrintDialog := False;
ppViewer1.Report.Print;
ppViewer1.Report.DeviceType := 'Screen';


PRINTING TO FILE:

ppViewer1.Report.AllowPrintToFile := True;
if UpperCase(DmMain.ReportAction) = 'MAIL' then
begin
ppViewer1.Report.DeviceType := 'HTMLFile';
ppViewer1.Report.TextFileName :=
IncludeTrailingBackslash(ExtractFilePath(Application.ExeName)) +
'AutoReport.HTM';
ppViewer1.Report.ShowPrintDialog := False;
end
else
begin
ppViewer1.Report.DeviceType := 'PDFFile';
ppViewer1.Report.TextFileName := '';
end;
ppViewer1.Report.Print;
//Settings back to standard.
ppViewer1.Report.ShowPrintDialog := True;
ppViewer1.Report.DeviceType := 'Screen';


Delphi version 5
ReportBuilder version 7.01 Enterprise.

Can you help me out here? I don't know what is going wrong.

Best regards,


Mischa E.J. Hoogendoorn
Charmed

Comments

This discussion has been closed.