Change Printer by Code - Solved!
dschuch
Dresden,Germany
Our customers use very different printers for different Reports (sometimes different user use the same Report but different Printers because they sit in different rooms). Problem: i was unable to save the last printer a user selected. (userspecific). So they print their reports regulary on the others printer... surprise surprise.
So I'v solved that stupid problem now, its very easy: (after some hours...)
include unit frxPrinter.
In code :
S:=.../Load From Registry
frxreport1.PrintOptions.Printer:=S;//thats the last selected printer
frxreport1.Print;
S:=frxPrinters.Items[frxPrinters.PrinterIndex].Name;//thats a global var defined in frxPrinter
//Save S to Registry.
Daniel
So I'v solved that stupid problem now, its very easy: (after some hours...)
include unit frxPrinter.
In code :
S:=.../Load From Registry
frxreport1.PrintOptions.Printer:=S;//thats the last selected printer
frxreport1.Print;
S:=frxPrinters.Items[frxPrinters.PrinterIndex].Name;//thats a global var defined in frxPrinter
//Save S to Registry.
Daniel