1
votes

I am developing a web application in which crystal reports are being used for Reporting.

Developing Environment : MS Visual Studio 2005 (ASP.NET, C#.NET And Crystal Reports)

I'am using the following lines of code

ReportDocument objRd=new ReportDocument();
objRd.Load("SomeReport.rpt");
objRd.SetParameterValue(0,"Value");
objRd.PrintOptions.PrinterName="The Printer Connected";
objRd.PrintToPrinter(1,false,0,0);
objRd.Close();

The code works fine in debug mode, the printer is getting invoked and i can get a print on the paper.

when the code is Live(hosted in IIS) after executing the line objRd.PrintToPrinter(1,false,0,0); no further process is going on (to check this i was gone to "Debug -> Attach to Process" in Visual Studio IDE and attached the Browser so that when i am accessing the Hosted website through URL i can get back to IDE and continue in Debug).

Either the system it self not getting hang or the Application.

I can redirect the ReportDocument to Crystal Report Viewer and can convert it to PDF,DOC etc., but i need to print the output directly to the printer.

Please Help me in solving the issue.

Thanks in Advance

EDIT

I am really feeling bad now that stackoverflow cannot solve my problem in a week(????).

Recently i tried a method suggested by my friend i.e. giving full access control to the hosted folder. still the issues stands :(.

1

1 Answers

0
votes

You need to put the crystal report javascript into live code iis folder. I am not sure extract location of the javascript right now. but search the c drive for crystal report javascript files. without this files you can not access any inbuilt function of crystal reports