views:

372

answers:

2

I have an application that runs through a series of bookings and prints each in turn in the form of an itinerary to send to clients. Each run could be 30 or so bookings so a need to automate this is required and we have delivered it.

All works well with our report software (Report Builder for DELPHI) except when the user wishes to use Duplex or some other property of the printer. The first print is OK and will Duplex but all other prints revert to the standard settings.

Now I have not found a solution via Report Builder (although their support is pretty good) and was wondering is there a straight forward way at a windows level to save the currently selected printer and ALL of its settings away and then on the next print just reinstate them. I don't mind if it is some VCL etc. I need to buy or just some code I need to cobble together I just need a solution.

A: 

From the answers given to you in the Digital Metaphors newsgroup it would seem that the ReportBuilder-owned printer setup is going to get applied by them before they output the report, so even if you find the specific solution you are seeking 'at a Windows level', you will still need to find a 'ReportBuilder' solution to get this working. Have you tried the OnInitializePrinterSetup event they suggest?

frogb
I have tried their suggestion and it works in terms of the basic printer setup so each 'print' goes to the same printer. I even checked the status of the duplex property and it was set to vertical duplex but it failed to duplex after the first output. I have two duplex printers available and neither works (one is a xerox and one a cannon so somewhat different printers).
Andrew Wood
Sorry it is not a cannon of course but a Canon MP600R ink jet.
Andrew Wood
+2  A: 

Actually this is quite a simple task, and then for each report just resend the printerinfo.

See the example at Torry for how to store current setting, you can also get from the printDialog info as well.

If you need a more detailed code sample of how to store and read details to INI file from the printer object let me know, and I will code one up for you.

Regards

RE

Reallyethical
I asked a similar question at http://stackoverflow.com/questions/1602068/save-printer-setup-parameters. It appears that this answer may apply for me as well. I would appreciate it if you could code up a brief example of saving this information to an INI file.
Will do in the morning when at a pc, coding on my phone never goes very well. RE
Reallyethical
Now that looks very interesting. I will give that a go as well.
Andrew Wood