Mark Rae said:
You can't - ASP.NET has no way of interfacing directly with the hardware on
the machine on which the client browser is running...
What use would this information be anyway...?
I have a user printing out of the Crystal Reports Viewer control version XI
R2. I need to know when they are printing, and unlike the VB6 version of
this control where you could trap the Print Event on the control itself,
there is no option for that in ASP that I've been able to determine. As
such, I need to add my own print button to the form, and trigger the
control's .printreport method. Because the user is printing on a special
form at this time, they may not be using their normal printer. While I can
control the printer name to use for printing as part of the Crystal Report
Viewer control, I can allow them to select a desired printer by going
through the system.printers collection and creating a drop-down list of
possible printers. At least I can do this when running in development on my
own machine. I've yet to try this from the IIS server, but will be doing so
soon. I'd like to offer up their default printer as the first choice, but
haven't been able to determine which of the several printers they may have
installed that this one is. Printing to the default printer hasn't been a
problem, since if I don't set any printer at all, it goes to default.
Still, I'd also like to log the printer used, but don't know what that
printer is.
The beta's of VS 2005 promised me that this would all be so very easy with
my.computer.printers and my.computer.printers.defaultprinter, and then they
ripped it away from me in the release version.
Even if it's harder to determine the default printer for a user, it should
hardly be impossible. But I don't know what to try next in this regard, and
was hoping for some help here.
When you need to track when and where a user prints controlled documents,
knowing this information can be very useful indeed.