Print to file problem
I'm currently writing an application that will produce a report to printer,
to screen and to text file.
The procedure that write to screen and to file functions correctly, but that
for text file seems always produce blank reports. Here are part of my source
code. Did I miss something?
procedure TForm6.btPrintToFileClick(Sender: TObject);
var
yy, mm, dd: word;
begin
decodedate(now, yy, mm, dd);
SaveDialog1.FileName := IntToStr(mm) + IntToStr(dd) + IntToStr(yy) +
'.txt';
if SaveDialog1.Execute then
begin
rpt.TextFileName := SaveDialog1.FileName;
rpt.DeviceType := dtTextFile;
// some initialization here
rpt.print;
end;
end;
rpt is the TppReport to save. Thank you for any suggestions.
to screen and to text file.
The procedure that write to screen and to file functions correctly, but that
for text file seems always produce blank reports. Here are part of my source
code. Did I miss something?
procedure TForm6.btPrintToFileClick(Sender: TObject);
var
yy, mm, dd: word;
begin
decodedate(now, yy, mm, dd);
SaveDialog1.FileName := IntToStr(mm) + IntToStr(dd) + IntToStr(yy) +
'.txt';
if SaveDialog1.Execute then
begin
rpt.TextFileName := SaveDialog1.FileName;
rpt.DeviceType := dtTextFile;
// some initialization here
rpt.print;
end;
end;
rpt is the TppReport to save. Thank you for any suggestions.
This discussion has been closed.
Comments
do this be either using the File | Print To File Setup dialog from the
designer or by toggling the Save property on the component you intend to
output to file.
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com