Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 29th, 2003, 03:53 PM
Registered User
 
Join Date: Sep 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to weekly_s
Default printing to server fails, and I dont know why

Hi,

I am not able to print to a network printer from my server. I have tried about everything the I can think of, including the advice given in the "print a report from the server" thread so far, to no avail. I need to be to give my users this funtionality, as some of them are running on older machines and can't afford the resource burden of opening Crystal enterprise and printing from there, while running the various other apps they have to have running. Anyway, back to the issue. Whenever I try to assign the PrinterName property, I get an "Invalid Printer Name" Following is my code snippet and the error message.


ReportDocument oRpt = new ReportDocument();
oRpt.Load(@"C:\GreenSheet\GreenSheet\Reports\Initi alSend.rpt");
oRpt.SetParameterValue("RequestID", CurrentRequestID);
oRpt.PrintOptions.PrinterName = @"\\bhsi\laser1";
oRpt.PrintToPrinter(1, true, 1, 1);

Ive also tried:


oRpt.PrintOptions.PrinterName = "\\\\bhsi\\laser1";

and I've even tried storing the name to a variable and then just dumping the variable into the PrinterName property. Either way I get the following error:

Error in File C:\GreenSheet\GreenSheet\Reports\InitialSend.rpt: Invalid printer specified.
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: CrystalDecisions.CrystalReports.Engine.InvalidArgu mentException: Error in File C:\GreenSheet\GreenSheet\Reports\InitialSend.rpt: Invalid printer specified.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidArgumentException: Error in File C:\GreenSheet\GreenSheet\Reports\InitialSend.rpt:
Invalid printer specified.]
.F(String  , EngineExceptionErrorID 
) +406
.A(Int16 , Int32 ) +537
CrystalDecisions.CrystalReports.Engine.PrintOption s.$(String  , String !, Int16* ", Int16* #, Int16* $, Int16* %) +808
CrystalDecisions.CrystalReports.Engine.PrintOption s.(String ) +249
CrystalDecisions.CrystalReports.Engine.PrintOption s.set_PrinterName(String value) +4
GreenSheet.Request.btnSubmit_Click(Object sender, EventArgs e) in c:\documents and settings\mis4\vswebcache\192.168.168.19\greensheet \request.aspx.cs:1106
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277

Thanks for any and all advice by the way. I glean more info from this forum then anywhere else it seems, and I buy WROX books all the time. The best.





Similar Threads
Thread Thread Starter Forum Replies Last Post
*.do URLs dont work in apache web server+tomcat haomomo Struts 1 August 29th, 2006 09:57 AM
Login Control fails on server PeterX ASP.NET 2.0 Basics 0 July 25th, 2006 10:53 AM
server fails to start z_idane Apache Tomcat 0 December 18th, 2005 12:51 PM
ch10 p 404 server.URLEncode dont work :( Timmo BOOK: Beginning ASP 3.0 0 February 3rd, 2004 03:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.