?
Solved

Invalid printer specified.

Posted on 2006-11-24
9
Medium Priority
?
5,904 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 700 total points
ID: 18009241
Are the printers the same kind?

Crystal is highly dependent on the printer driver.

mlmcc
0
 

Author Comment

by:Albvision
ID: 18009259
Printers are NCR Printer 7197 same type.
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 700 total points
ID: 18009868
Are the printers always available?

Do all users have permissions on them?

mlmcc
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:Albvision
ID: 18010678
Yes, all of users have the same premissions on both printers.
0
 
LVL 2

Assisted Solution

by:AtulKamdar
AtulKamdar earned 300 total points
ID: 18011180
put some delay between to print commands.
0
 

Author Comment

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

Accepted Solution

by:
mlmcc earned 700 total points
ID: 18046161
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
ID: 18049694
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 101

Expert Comment

by:mlmcc
ID: 18180228
Glad i could help

mlmcc
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

762 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