Print to pdf-file without a preview
Hello,
Somehow, my reports keep showing up in the default browser after I print them.
How can I prevent this?
I create a report-component runtime, load the layout from the database, and set the following properties:
rep.PrinterSetup.DocumentName := AReportName;
rep.PrinterSetup.BinName := 'Default';
rep.ShowCancelDialog := False ;
rep.AllowPrintToFile := true ;
rep.TextFileName := AFileName;
rep.ShowPrintDialog := False;
rep.DeviceType := PDF;
After calling rep.print the file is always opened in Google Chrome.
How can I prevent this?
btw: The "openfile" property of the loaded layout is "False"
kind regards,
Dirk Janssens.
Somehow, my reports keep showing up in the default browser after I print them.
How can I prevent this?
I create a report-component runtime, load the layout from the database, and set the following properties:
rep.PrinterSetup.DocumentName := AReportName;
rep.PrinterSetup.BinName := 'Default';
rep.ShowCancelDialog := False ;
rep.AllowPrintToFile := true ;
rep.TextFileName := AFileName;
rep.ShowPrintDialog := False;
rep.DeviceType := PDF;
After calling rep.print the file is always opened in Google Chrome.
How can I prevent this?
btw: The "openfile" property of the loaded layout is "False"
kind regards,
Dirk Janssens.
Comments
Try placing a breakpoint in the TppFileDevice.EndJob routine (ppFilDev.pas file line 1187) to see if the OpenFile property is indeed False.
This is the only place an exported file will be automatically opened. If it is not executed, the issue is not with RB.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
The property is indeed "true". I also found the cause in my code:
After this line :
rep.XLSSettings.OpenXLSFile := true ;
The property openfile is changed.
(rep.openfile = true.)
I would expect that this property would only effect Excel files, and not the pdf.
Is this by design?
kind regards,
Dirk Janssens.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com