Problem when outputting to pdf
D7, WinXP SP2, RB 9.02 Ent
I'm trying to sent a report to a pdf file without user intervention using
the code below:
begin
if fileexists('C:\Orders.pdf') then
deletefile('c:\Orders.pdf');
dm1.Specials.Open;
dm1.H220.Open;
dm1.H220.IndexName := 'rep_date';
dm1.H220.SetScope(formatdatetime('yyyymmdd', fromdate.date),
formatdatetime('yyyymmdd', todate.date));
if emailreport.Checked then
begin
Rpt.Reset;
PPDBTEXT4.DisplayFormat := '';
Rpt.AllowPrintToFile := True;
Rpt.TextFileName := 'c:\orders.pdf';
Rpt.DeviceType := 'PDF';
Rpt.ShowPrintDialog := False;
Rpt.Print;
end
else
begin
PPDBTEXT4.DisplayFormat := '**********************';
Rpt.AllowPrintToFile := False;
Rpt.DeviceType := dtScreen;
Rpt.ShowPrintDialog := True;
Rpt.Print;
end;
end;
If the emailreport is checked the the output file i.e. orders.pdf contins no
data - however if I output the report to the screen then the report is fine
i.e. shows data for select dates.
I placed a dbgrid on the screen to see where things were going wrong. If
the output is directed to pdf then as the rpt.print is processed the dbgrid
goes blank. Help.
btw. removing the setscope on the datafile the whole file is output ok to
the pdf file. ???
I'm trying to sent a report to a pdf file without user intervention using
the code below:
begin
if fileexists('C:\Orders.pdf') then
deletefile('c:\Orders.pdf');
dm1.Specials.Open;
dm1.H220.Open;
dm1.H220.IndexName := 'rep_date';
dm1.H220.SetScope(formatdatetime('yyyymmdd', fromdate.date),
formatdatetime('yyyymmdd', todate.date));
if emailreport.Checked then
begin
Rpt.Reset;
PPDBTEXT4.DisplayFormat := '';
Rpt.AllowPrintToFile := True;
Rpt.TextFileName := 'c:\orders.pdf';
Rpt.DeviceType := 'PDF';
Rpt.ShowPrintDialog := False;
Rpt.Print;
end
else
begin
PPDBTEXT4.DisplayFormat := '**********************';
Rpt.AllowPrintToFile := False;
Rpt.DeviceType := dtScreen;
Rpt.ShowPrintDialog := True;
Rpt.Print;
end;
end;
If the emailreport is checked the the output file i.e. orders.pdf contins no
data - however if I output the report to the screen then the report is fine
i.e. shows data for select dates.
I placed a dbgrid on the screen to see where things were going wrong. If
the output is directed to pdf then as the rpt.print is processed the dbgrid
goes blank. Help.
btw. removing the setscope on the datafile the whole file is output ok to
the pdf file. ???
This discussion has been closed.
Comments
If possible, please send a small example demonstrating this behavior in .zip
format to support@digital-metaphors.com and I'll take a look at it for you.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I use apollo tables and I think the problem is when a scope has been set. I
will investigate the problem further. The strange thing is that output to
the screen and selecting output then to file (pdffile) works ok ??
Yes that is very strange. If you would like, you can send me a copy of the
pdf file that shows this behavior and I can look at the PDF code for clues
to what is happening. Just be sure to export to PDF with the
CompressionLevel property in the PDFSettings set to "None".
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com