Change Printer by Code - Solved!

dschuchdschuch Dresden,Germany
edited 7:52PM in FastReport 3.0
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


Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.