A lot of Rave-user haven't realize that Rave can manage the destination of the print result with out the way of the printer-class, especially the choice of the bin/tray ...
Of course, you can use function like the following to read out the tray from you printer-driver and develop a solution
....
GetPrinter(ADevice,ADriver,APort,hDMode);
pDevMode := nil;
Res := DeviceCapabilities(ADevice,APort,DC_BINNAMES,PCHAR(@(bin[0][0])),pDevMode);
....
But there is an easier way with Rave.
Nevrona Designs have built a "Printer device manager class" called RpDevice.
Insert RpDevice in your uses and then you can work with RpDev.
This function return the current RPDevice object for manage the printer in your app.
RpDev.InvalidPrinter is the first command and with this you can check on the user-machine if there is a correct printer installed or not, e.g. on some servers with running applications aren't installed any printer.
RpDev.Device shows the (selected) printer and RpDev.Printers shows the installed printers on the system.
RpDev.Bins read the installed trays for the selected printer.
RpDev.Papers for the papers (from the driver)
I use Duplex-Mode where ever I can...
With RpDev.SupportDuplex exits an easy way to check if the printer(driver) support duplex or not...
The previous commands only read informations, with RpDev.Select... you can define the destination printer, tray, paper and more
RpDev.SelectPrinter(ComboBox1.Text, true);
To save properties on the printer in the OS you can use RpDev.SaveToPrinter;
Before you execute a report you should define all the things in your code and the result is as expected
In the RpDev-class you'll find many more and I hope I've opened the door to the possibilities!
The information is interesting, although the text could use some tuneup: it's a bit "GermanEnglish"... :)
AntwortenLöschenI tried to e-mail you some changes to make the text easier to read, should you want to incorporate them, but I couldn't find any e-mail address... Maybe next time.
Hi. I started using Rave (5.0.8 with D7) not so long ago. Because the OutpuOptins screen didnt helped me i made my own. I've added the print option, my preview option, a save to pdf option and a send to email option. I use the RPDev function to modify the printer functionality. The problem i got, beside many others :), is that i'm using a TRvRenderPrinter for printing my report. I just wanna ask: is there any way to print any number of copies i want? It always prints just 1 copie (i use .Render(NDRStream)) and resets the number of copies from my RPDev (wihch i set in my Output Option screen) to 1.
AntwortenLöschenAnd another question. I dont really undertand how RPDev.SaveToPrinter, RPDev.ResetHandler(0) and RPDev.LoadFromPrinter could alter my TRVRenderPrinter functionality.
AntwortenLöschenRpDev.Bins.count is always 0 though
AntwortenLöschenthe selected printer definitely has different trays. What could be the reason for this?
Excellent job. Keep publishing posts!
AntwortenLöschenMany thanks for making the effort to write such a beneficial article, it's recently been worthwhile.
AntwortenLöschenIt can be sad that you have people out there never browsing this website. Great job
AntwortenLöschenThanks to you for the content concerning this issue, it turned out very useful.
AntwortenLöschenPretty secti᧐n of content. Ӏ just stumbled upon your site and in accession capital to assert that I acquire in fact enjoyed аccount your blog рosts.
AntwortenLöschenAny way I'll be subscribing to your feeds and even I achievеment you
access consistently quickly.