Crystal Reports - PrintToPrinter "The handle is invalid"
I'm using the Crystal Reports Basic for Visual Studio 2008 to print reports. I have just one user that gets periodic errors saying "The handle is invalid". If she tries printing a second time, it works just fine. I've looked over 开发者_JAVA百科her machine and it looks like it has all the same software as everyone else, and of course it never happens when I'm around.
The code I'm using is: frmPrint.LogTag1.PrintToPrinter(1, True, 1, 0)
It is a low-level Windows error. Could be a bug in Crystal Reports, could be a bug in the printer driver, could be environmental with some kind of misbehaving system add-on. You'll never find out which it is if you don't have the source code for these large chunks of code so you can debug it. You don't and you can get it.
It is not a bug in your code, ask the IT staff to get that user another machine. If that doesn't help then you'll have to bounce this to Crystal Decisions (or whatever they are called these days). This is otherwise a standard IT matter.
精彩评论