Delphi – Last printer used when printing with Fast Report (in Delphi)


How to retrieve last user selected printer when printing from a preview window in Fast Report (Basic Edition ver. 4.7.1)?

I tried


in OnAfterPrintReport event but it only returns the system default printer.

After the user prints the report, the program prints a few Word documents and I need to know which printer was used last.

Best Solution

Using API Hook to store last used printer is a little too much, isn't it?

I found this better approach in the FastReport official forum:

S:=.../Load From Registry
frxreport1.PrintOptions.Printer:=S;//thats the last selected printer
S:=frxPrinters.Items[frxPrinters.PrinterIndex].Name;//thats a global var defined in frxPrinter
//Save S to Registry.
Related Question