cancel
Showing results for 
Search instead for 
Did you mean: 

error when print "a communication error occurred. printing will be stopped"

Former Member
0 Kudos

Software: Crystal report 11 SP2 and ASP.Net 2005

problem occurred when deploy to the one of the servers.

Server A: Installed with crystal report 11 SP2 and Visual studio. It is working fine and able to print.

For IIS setting is using the Default Web Site.

Server B: server without installation. When print get a error must from crystal report window indicate that "a communication error occurred. printing will be stopped".

For the IIS setting, I am not using the Default Web Site but another named web site.

Try copy the aspnet_client from Server A to B (named web site) and still not working.

Please help....Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Colleages,

My company is having a similar issue. It occurrs in this sequence:

1. User selects a Report from the application.

2. User clicks on the "Printer" icon from the tool bar of the Crystal Viewer ( this means that the Crystal Server has already created the Report).

3. User clicks on the desired printer (from the Windows Dialog Box), which is usually the default printer.

4. The "Crystal Report Viewer -- Dialog..." window displays a message "Retrieving Page 1" and the "Cancel" button.

5. After several second of waiting, the message Box "Crystal Reports Print Control" displaying "An communication error ocurred. Printing will be stopped"

We use Crystal RAS XI to serve a Tririga Web application.

If any one can help us to find the right direction, we will appreciate it.

Eduardo.

daniel_paulsen
Active Contributor
0 Kudos

For the Proxy case, try placing the printcontrol.cab file in the root of your application and add the following to your web.config (note this is only for apps using the .NET 2.0 framework)

<configSections>

<sectionGroup name="businessObjects">

<sectionGroup name="crystalReports">

<section name="printControl" type="System.Configuration.NameValueSectionHandler" />

</sectionGroup>

</sectionGroup>

</configSections>

<businessObjects>

<crystalReports>

<printControl>

<add key="url" value="http://server_name/app_name/PrintControl.cab" />

</printControl>

</crystalReports>

</businessObjects>

Former Member
0 Kudos

Daniel, thanks for responding to my question.

The thing is that our Tririga application does is not a .NET, it is a Java Application. Would you recommend anything else?

Regards,

Eduardo

former_member183750
Active Contributor
0 Kudos

As this forum is dedicated to topics related to custom application development or deployment with Crystal Reports in .Net. This includes full versions of Crystal Reports as well as those versions of Crystal Reports bundled with Microsoft Visual Studio .NET and you are using Java, I'd recommend you pose the question in the Java forum:

Ludek

Former Member
0 Kudos

I too have the same problem. Only difference is i am getting "An error occured in ther server. Printing will be stopped." We are having asp application to view Crystal report. Please help me in this regard.

former_member183750
Active Contributor
0 Kudos

Is your app able to "see" the printers? try this code to get a list of printers availabel to your app:

Dim myPrinter As String

For Each myPrinter In System.Drawing.Printing.PrinterSettings.InstalledPrinters

Response.Write(myPrinter)

Response.Write("<BR>")

Next

Ludek

Former Member
0 Kudos

I tried the web.config changes because we do have a proxy server in our environment, and am still receiving the communications error. Are there any other suggestions?

Edited by: chihuachsund on Aug 28, 2009 8:04 PM

former_member183750
Active Contributor
0 Kudos

If you add the priner code from my last post, does your app see the printer9s)?

Ludek

Former Member
0 Kudos

I had done that previously, but it only sees the printers on the server. I'm actually getting a print dialog, selecting a printer, and when I click "Print", that's when the error pops up.

I did a trace with Fiddler, and I get this in the response when the error pops up:

<html>

<head>

<title>Access is denied.</title>

<style>

body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}

p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}

b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}

H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }

H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }

pre {font-family:"Lucida Console";font-size: .9em}

.marker {font-weight: bold; color: black;text-decoration: none;}

.version

.error {margin-bottom: 10px;}

.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

</style>

</head>

<body bgcolor="white">

<span><H1>Server Error in '/NACAR' Application.<hr width=100% size=1 color=silver></H1>

<h2> <i>Access is denied.</i> </h2></span>

<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

<b> Description: </b>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.

<br><br>

<b> Exception Details: </b>System.Runtime.InteropServices.COMException: Access is denied.<br><br>

<b>Source Error:</b> <br><br>

<table width=100% bgcolor="#ffffcc">

<tr>

<td>

<code>

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.</code>

</td>

</tr>

</table>

<br>

<b>Stack Trace:</b> <br><br>

<table width=100% bgcolor="#ffffcc">

<tr>

<td>

Also, a filemon trace on the server side shows that the server is trying to find a file in the c:\windows\temp folder that appears to be a copy of my report with a generated-guid file name, but can't find it. I tried setting permissions in the c:\windows\temp folder for the network service, but it didn't help. The application log on the server shows a "Failed to Load Report" error, which looks like it's trying to read that report from the windows\temp directory to print it, but it isn't there.

former_member183750
Active Contributor
0 Kudos

There are read / write permissions set on the temp folder?

Ludek

Former Member
0 Kudos

Yes, I just verified permissions, and added full control for Everyone, still no luck. The filemon trace doesn't even show the attempt to create the file that it's trying to open.

I even copied the site to my local hard drive, and ran it through Visual Studio, and got the same problem.

It looks like the engine is supposed to create this temp file, then read it to do the printing, but it's not creating the temp file.

former_member183750
Active Contributor
0 Kudos

If you are using HTTPS and have No-Cache set. This will prevent temp files copied client-side. Is this your case at all?

If so, try setting Cacheability to Private and set the timeout to 1 min or so to allow printing.

Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));

Response.Cache.SetCacheability(HttpCacheability.Private);

Ludek

Former Member
0 Kudos

I tried adding

Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))

Response.Cache.SetCacheability(HttpCacheability.Private)

to my page_load codebehind and it still didn't help.

I'm wondering if there is a version conflict somewhere? Is there any way I can tell what version(s) of the Crystal report engine are installed on my web server? In my c:\windows\assembly folder, I see version 10.2.3600.0 as well as 10.5.3700.0 for the crystal entries.

here are the assemblies from my web.config:

assembly="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

assembly="CrystalDecisions.ReportSource, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

assembly="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

assembly="CrystalDecisions.Enterprise.Framework, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

Edited by: chihuachsund on Sep 1, 2009 4:02 PM

former_member183750
Active Contributor
0 Kudos

From what you are describing, one thing it does not look like is a dll issue. But you can check what dlls the app is loading by using the [Modules |https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] utility.

A good test here will be to not use HTTPS. Are you able to print with just a simple HTTP (just a test)?

Ludek

Former Member
0 Kudos

Sorry Ludek, I forgot to mention that we are not using HTTPS, but I tried your suggestion anyway just to see if it helped. Do you think it's worth checking the Modules utility?

former_member183750
Active Contributor
0 Kudos

Well, Modules is quick and easy to use. Seeing as we have not much else else to go on, let's see what that says.

Process Monitor will also be a good utility to try:

http://technet.microsoft.com/en-ca/sysinternals/bb896645.aspx

Filter Proc mon for your process or you'll get buried in log data. Look for Access Denied messages. Also, look at the report file and what is happening to it. Is it being written? Is it being deleted? Etc.

Ludek

Former Member
0 Kudos

Hi Ludek,

I ran procmon, and there was an access denied message trying to create a registry key for

HKLM\SOFTWARE\Business Objects\10.5\Report Application Server\InProcServer

I checked, and this reg key already exists, so that may be the reason it got the error.

There were also a few NAME NOT FOUND errors looking for

HKU\S-1-5-20\Software\Business\Objects\10.5\Report Application Server\InProcServer

HKU\S-1-5-20\Software\Business\Objects\10.5\Report Application Server\InProcServer\LocalconnectionMgr

I could also see where it was trying to open the GUID-filename rpt file in the C:\windows\temp folder, but never saw it attempt to write it.

I saved the procmon trace to a file if you would like to peruse it, just let me know where to upload it.

Thanks again for your help! -Eric

former_member183750
Active Contributor
0 Kudos

The only other thing I can think of is to make the viewers folder a subdirectory of the application and configure the path for it in the web.config. This will set up a relative path that should work with the proxy. Now I am sure that officially this was introduced in CR XI r2 and so it may not work with CR 10.5. But try the following:

Specify the URL for the CrystalReportWebFormViewer4 folderu2019s in the web.config file as follows:

<configSections>

<sectionGroup name="businessObjects">

<sectionGroup name="crystalReports">

<section name="crystalReportViewer"

type="System.Configuration.NameValueSectionHandler ; , System, Version=1.0.3300.0, Culture=neutral,

PublicKeyToken=b77a5c561934e089, Custom=null " />

</sectionGroup>

</sectionGroup>

</configSections>

<businessObjects>

<crystalReports>

<crystalReportViewer>

<add key="ResourceUri" value="" />

</crystalReportViewer>

</crystalReports>

</businessObjects>

The URI would be ~/CrystalReportWebFormViewer4, but CrystalReportWebFormViewer4 folder must be copied into the web applications folder.

If the above does not work, and yo do need to use proxies, it may be worthwhile seeing if CR 2008 does the trick for you. Eval of CR 2008 can be downloaded from here:

http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx

Other than that, consider creating a phone case and discussing with a support engineer Phone cases can be obtained here:

http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryI...

Ludek

Answers (4)

Answers (4)

Former Member
0 Kudos

I try this code. It's work (on Windows Server 2008 R2 and IIS 7)

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div>

<CR:CrystalReportSource ID="CrystalReportSource1" runat="server"></CR:CrystalReportSource>

</div>

<div>

<asp:ObjectDataSource ID="" runat="server"></asp:ObjectDataSource>

<div>

<div>  ---must at last content

        <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" />

</div>

</asp:Content>

Former Member
0 Kudos

I would also like to add to this thread that I am getting this issue with a clean install of CR 2008. Here is the background:

Installed VS 2008 SP1 on a new machine, running WinXP SP3 - all updates up to date.

Installed CR 2008 and service packs SP0, SP1 and SP2.

I can design reports and connect to databases with no issues.

Have created a simple ASP.NET web project with one page that uses the Crystal Viewer and Crystal Report Source controls.

Web page works fine - can view report, export report and print via export to PDF/print.

However, I get the same issue mentioned in this thread trying to use the ActiveX Print Control:

Click Print icon

Prompted to install the CR print control (on first use) - click OK to install, short pause afterwards.

Error message appears "An communication error occurred. Printing will be stopped"

In order to check that this might be an issue with the test machine, I tried this on two other machines on our network, by loading the test web page through IE7 (WinXP) and IE8 (Windows 7) - same issue. They each download the Print Control, but then the error message pops up.

Printer is online, users can print from other apps, but CR print control refuses to work. Also, tests not through HTTPS nor a Proxy.

I followed the advice above to check with Process Monitor - I get similar results, including access to the print spooler, so it looks like printing gets so far then fails. I cannot determine the reason why from the log though.

I'm suprised there are fewer hits for this issue when Googling it (and searching this forum).

Our company were ready to ditch Crystal Reports due to constant issues with deployment over the years (amongst other things) but wanted to give CR2008 a chance - then this potential show stopper!

I know users can still print via PDF, but the straight through route is preferred as users will often complain to us when their processes are slowed down by extra 'mouse clicks', expecially those users working with our software in Call Centers).

Hoping someone can help!

former_member183750
Active Contributor
0 Kudos

Have you had a chance to look at the [Problem of installing Crystal Reports 2008 Print Control(ActiveX)|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417500)ID1617741650DB11112347389125823727End?blog=/pub/wlg/14395] blog?

Also, are you able to use the activeX print if you are right on the server where the app is installed?

Ludek

Former Member
0 Kudos

Hi Ludek,

I've tried this on the actual server machine, on a WinXP machine on the network (same domain) and on a Windows 7 pc, also on the same network/domain.

The prompt appears first time round to install the activex print control, afterwhich a short pause whilst it installs, then the "communication" error. Subsequent attempts go straight to the error.

The machines also re-downloaded the activex print control after I service packed CR2008 to SP2.

I'll have a look at that blog now to see if there's anything in there that helps.

Regards, Paul.

former_member183750
Active Contributor
0 Kudos

Please do have a look at that blog. Also, check to see that the printer is "visible" to the worker process.

Ludek

Former Member
0 Kudos

Hi Ludek,

I now have it working.

In my test page, I change the datasource of the report in Page_Load, skipping this piece of code for Postbacks.

I can view the report, and navigate it with no issues, and even export the report. However, trying to print won't work and this is when I get the ActiveX Print Control error.

So, I changed the code in Page_Load to always set the datasource, even on PostBack, and now it works.

Ideally, I'd only like to set the datasource when the page is first loaded and not on every postback; thankfully, I've found a way to do this.

When I click the Print button, the page posts back. I can then check the QueryString on PostBack to look at Request("ServletTask"). If the value of this is set to "Print" then I know to set the datasource again.

Using this method seems to work fine.

Hope that helps someone else too.

Thanks also for your help Ludek.

Former Member
0 Kudos

PaulMc, I just tried that and it worked for me as well. Awesome job! I had finally abandoned that process and went to the report.printtoprinter function for my project, but I will remember this for future reference.

Also, thank you Ludek for all your help on this.

former_member183750
Active Contributor
0 Kudos

Paul, thank you so much for this. I'll have to play around with your solution and probably create a kbase / note on it.

have a great weekend,

Ludek

Former Member
0 Kudos

No reply for over 1 month, closing post

former_member183750
Active Contributor
0 Kudos

Server B: server without installation

Do you mean no Crystal Reports runtime? E.g; you did not run any CR MSI or msm?

Ludek

daniel_paulsen
Active Contributor
0 Kudos

after you get the communication error, close that dialog and right-click on the web page in the browser and select View Source.

In the source, search for the word "Printcontrol" this will show you the virtual path to the Printcontrol.cab file. Does it exist? If not, copy the file to the location it is looking for to ensure the path to the file is available in the custom site.

If this does not work, reply with the path you are seeing in the HTML source. Also, is there a proxy server involved in your environment?

Dan

Former Member
0 Kudos

Crystal report runtime installed

Former Member
0 Kudos

yes I can the cab in the view source and the path is correct.

One more thing, I am able to export the report into pdf,execl...etc without any errors but cannot print.

proxy server involved.