Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer name error: Invalid printer specified

Status
Not open for further replies.

yaohuang

Programmer
Jun 10, 2005
3
0
0
CA
I am tring to print crystal report on a printer server on intranet. The Printer setting on control panel is:
1. The share name of this printer is HP1200
2. The printer server name is printservdev

So in my C# (ASP.NET) code, it is:

report.PrintOptions.PrinterName = @"\\printservedev\HP1200";
report.PrintToPrinter(1,false,0,0);

But it always complains that:
CrystalDecisions.CrystalReports.Engine.InvalidArgumentException: Error in File C:\DOCUME~1\NIMBUS\ASPNET\LOCALS~1\Temp\temp_b2857a67-9cae-4f1e-9c0d-01e1e4e4c804.rpt: Invalid printer specified.


Can some one help me?
Thanks a lot.




 
Hi
If you want to use the server control you can print to any local printer =
set up on the server. If you are doing this for internal use, this =
should work out for you. We set up any remote printers on the network =
as TCP/IP local printers on the server, then populate a drop down box =
with those printers. Then I use the crystal viewer to print to that =
printer, like:
crystalReportObject.Load()
crystalReportObject.SetDataSource(myDs)
crystalReportObject.PrintOptions.PrinterName =3D =
ddlPrinters.SelectedItem.Value
crystalReportObject.PrintToPrinter(1, False, 0, 0)
crystalReportObject.Close()
HTH



pgtek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top