tags:

views:

238

answers:

1

Hi

I am trying to print some custom stuff on a network printer and getting following exception. Any idea what is causing it and how to solve it? I have checked that I have permission to print using the network printer.

System.ComponentModel.Win32Exception: The operation completed successfully
   at System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal()
   at System.Drawing.Printing.PrinterSettings.GetHdevmode(PageSettings pageSettings)
   at System.Drawing.Printing.PrintController.OnStartPrint(PrintDocument document, PrintEventArgs e)
   at System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPrint(PrintDocument document, PrintEventArgs e)
   at System.Drawing.Printing.PrintController.Print(PrintDocument document)
   at System.Drawing.Printing.PrintDocument.Print()

The code is written in C# .net 3.5.

Thanks

A: 

It's very hard to answer with no code and an exception that says you everything is OK. So I'll just give a few ideas to track down the problem

  1. Test it on a local printer to make sure the application works.
  2. Try printing to the networked printer using notepad or something similar
  3. Double nay triple check that the user the application is running as has permissions to print to the network printer.
  4. Test it on another networked printer (after doing 2 and 3 for that printer)
Nifle