Solved

Invalid printer specified.

Posted on 2006-11-24
9
5,666 Views
Last Modified: 2011-02-18
I have a windows application developed in C#. My application need to print in two local printers 'av1' and 'av2'. I use the following code:

...
rpt.SetParameterValue("xx", owner.ZipCode);
rpt.SetParameterValue("xx", dtFrom.Value.ToShortDateString());
rpt.SetParameterValue("xx", mSales.Summary.ToString("C"));

rpt.PrintOptions.PrinterName ="av1";
rpt.PrintToPrinter(1, true, 0, 9999);
...

and same for the other printer

...
rpt.PrintOptions.PrinterName ="av2";
rpt.PrintToPrinter(1, true, 0, 9999);
...

The problem is that somtimes it works and sometimes occurs exception:
{System.Runtime.InteropServices.COMException (0x80000201): Invalid printer specified.
   at CrystalDecisions.ReportAppServer.Controllers.PrintOutputControllerClass.ModifyPrinterName(String newVal)
   at CrystalDecisions.CrystalReports.Engine.PrintOptions.set_PrinterName(String value)
   at Administrimi.ListSalesForm.btnPrint_Click(Object sender, EventArgs e) in F:\MyProgs\DotNet\MyApplication\Administrimi\ListSalesForm.cs:line 233}

Any suggestion?
0
Comment
Question by:Albvision
  • 4
  • 4
9 Comments
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 350 total points
Comment Utility
Are the printers the same kind?

Crystal is highly dependent on the printer driver.

mlmcc
0
 

Author Comment

by:Albvision
Comment Utility
Printers are NCR Printer 7197 same type.
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 350 total points
Comment Utility
Are the printers always available?

Do all users have permissions on them?

mlmcc
0
 

Author Comment

by:Albvision
Comment Utility
Yes, all of users have the same premissions on both printers.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Assisted Solution

by:AtulKamdar
AtulKamdar earned 150 total points
Comment Utility
put some delay between to print commands.
0
 

Author Comment

by:Albvision
Comment Utility
I tried but same again. For example it works for five hour after that time occourd the error.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 350 total points
Comment Utility
Can a printer be moved offline or reserved by a user?

Can a printer get overloaded or a print queue be full?

mlmcc
0
 

Author Comment

by:Albvision
Comment Utility
The problem who we have is showed above. The Printers are normally installed in the same form and the once is Primary (the default) and the other is as secondary installed. Both printers are OK configured through NCR Tool and are working.

Both printers can be moved offline and online and can be reserved by a user.

Yes, the printer do from time to time an "limited by administrator processing capacity". Maybe you know the problem?!

Regards and many thanks for your help!
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Glad i could help

mlmcc
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now