B
Brett
I have an ASP.NET page that displays work orders in a GridView. In that
GridView is a checkbox column. When the user clicks a "Print" button, I
create a report, using the .NET Framework printing classes, for each of the
checked rows in the GridView. This works fine in the Visual Studio 2005
development environment on localhost. But, when I move the page to the web
server, I get the error "Settings to access printer
'\\ServerName\PrinterName' are not valid." (See below.) I get the same
error if I try this while logged into the server, but I can successfully
print a test page from the server.
This printer is installed on the server and is the default printer. The
server is running Windows Server 2003 R2 Service Pack 2, IIS 6 and ASP.NET
2.0.50727.0. Is there any way that I can have this report print when the
page is hosted on the web server? Thank you!
Settings to access printer '\\COLUMBIA\IT Hallway FS-3820N KX' are not
valid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Drawing.Printing.InvalidPrinterException: Settings
to access printer '\\COLUMBIA\IT Hallway FS-3820N KX' are not valid.
Source Error:
Line 194:Line 195: PrintDoc.Print()Line 196:
PrintDoc.Dispose()Line 197: End Sub
Source File: C:\Inetpub\wwwroot\MaintenanceManager\WorkOrders.aspx.vb
Line: 195
Stack Trace:
[InvalidPrinterException: Settings to access printer '\\COLUMBIA\IT Hallway
FS-3820N KX' are not valid.]
System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal() +123451
System.Drawing.Printing.PrinterSettings.GetHdevmode(PageSettings
pageSettings) +48
System.Drawing.Printing.PrintController.OnStartPrint(PrintDocument document,
PrintEventArgs e) +81
System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPrint(PrintDocument
document, PrintEventArgs e) +33
System.Drawing.Printing.PrintController.Print(PrintDocument document) +201
System.Drawing.Printing.PrintDocument.Print() +111
_Default.PrintWorkOrder() in
C:\Inetpub\wwwroot\MaintenanceManager\WorkOrders.aspx.vb:195
_Default.btnPrint_Click(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\MaintenanceManager\WorkOrders.aspx.vb:180
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,
String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +1746
GridView is a checkbox column. When the user clicks a "Print" button, I
create a report, using the .NET Framework printing classes, for each of the
checked rows in the GridView. This works fine in the Visual Studio 2005
development environment on localhost. But, when I move the page to the web
server, I get the error "Settings to access printer
'\\ServerName\PrinterName' are not valid." (See below.) I get the same
error if I try this while logged into the server, but I can successfully
print a test page from the server.
This printer is installed on the server and is the default printer. The
server is running Windows Server 2003 R2 Service Pack 2, IIS 6 and ASP.NET
2.0.50727.0. Is there any way that I can have this report print when the
page is hosted on the web server? Thank you!
Settings to access printer '\\COLUMBIA\IT Hallway FS-3820N KX' are not
valid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Drawing.Printing.InvalidPrinterException: Settings
to access printer '\\COLUMBIA\IT Hallway FS-3820N KX' are not valid.
Source Error:
Line 194:Line 195: PrintDoc.Print()Line 196:
PrintDoc.Dispose()Line 197: End Sub
Source File: C:\Inetpub\wwwroot\MaintenanceManager\WorkOrders.aspx.vb
Line: 195
Stack Trace:
[InvalidPrinterException: Settings to access printer '\\COLUMBIA\IT Hallway
FS-3820N KX' are not valid.]
System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal() +123451
System.Drawing.Printing.PrinterSettings.GetHdevmode(PageSettings
pageSettings) +48
System.Drawing.Printing.PrintController.OnStartPrint(PrintDocument document,
PrintEventArgs e) +81
System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPrint(PrintDocument
document, PrintEventArgs e) +33
System.Drawing.Printing.PrintController.Print(PrintDocument document) +201
System.Drawing.Printing.PrintDocument.Print() +111
_Default.PrintWorkOrder() in
C:\Inetpub\wwwroot\MaintenanceManager\WorkOrders.aspx.vb:195
_Default.btnPrint_Click(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\MaintenanceManager\WorkOrders.aspx.vb:180
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,
String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +1746