Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Relevent Code:

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Shared

Private cr As CrystalInvoiceSingle

cr.PrintOptions.PrinterName = CurrentPrinter()
cr.PrintToPrinter(1, False, 0, 0)


This code runs fine on the development machine (Windows 7, VS 2010, 64-bit) but on a production machine, running Window 7 64-bit, an error 91 (Object reference not found . . . .) occurs at cr.PrintOptions.PrinterName (if I specify a printer) or at cr.PrintToPrinter (if I do not specify a printer).

I've ensure that all of the CrystalDecision references are set to 'copy local' and I've ensured that the files are all there, but the error remains. I feel certain that this is due to a call to a missing ddl, but I can't determine which.

Any help would be appreciated.

Thanks.
Posted

1 solution

Just a thought, in your production machine, do you have some printer defined as default printer? I would suspect that if not, CurrentPrinter() would fail...
 
Share this answer
 
Comments
T3mplarKn1ght 29-Mar-11 15:50pm    
I should have clarified that CurrentPrinter is a string variable. I've already tested to ensure that this isn't related to which printer is selected or whether the printer is the default printer or not. The printer name is derived by the logged in user, but I've already tested to ensure that the issue isn't related to the logged in user.

Thanks for the thought, though.
Wendelius 29-Mar-11 16:08pm    
Ok, another thing. Since you're using CrystalInvoiceSingle class, it must be a custom class (possibly derived from reportDocument). Does that class override those methods?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900