Error after printing.
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
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
This discussion has been closed.
Comments
Is this the problem when printing to PDF: ppViewer1.Report.TextFileName
:= '';
Can you simply print to a report emulation text file as a test, to take the
add on devices out of the equation?
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com