cancel
Showing results for 
Search instead for 
Did you mean: 

Facing issues in crystal reports while download and on Navigation buttons

Former Member
0 Kudos

Hi,

We have brought up the setup for Crystal Report 2011, connected it to SQL 2008 DB and are able to view the reports. But we are facing 2 issues:

1. On click of Download button, the URL gets changed to below and we get a blank screen.

http://localhost:9080/CrystalReportViewerHandler

2. For reports which have more than 1 page, on click on “Next” button, it’s not proceeding to next page. Instead a pop message is displayed to the user as below:

“The viewer is unable to connect with the CrystalReportViewerServlet that handles asynchronous requests. Please ensure that the Servlet and Servlet-Mapping have been properly declared in the application’s web.xml file”

We have verified that our entries are proper in web.xml.

<context-param>

<param-name>crystal_servlet_uri</param-name>

<param-value>/CrystalReportViewerHandler</param-value>

</context-param>

<servlet>

<servlet-name>CrystalReportViewerServlet</servlet-name>

<servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>CrystalReportViewerServlet</servlet-name>

<url-pattern>/CrystalReportViewerHandler</url-pattern>

</servlet-mapping>

Kindly let us know if anyone has any inputs.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

I am soooooo confused....

CR 2011 does not install any SDK so I am not sure what you are actually referencing when you quote the web.xml.

I have no idea what "On click of Download button" means? Where do you see the download button? Screenshot may be worth a 1000 words here...

Are you trying to run the report from some app created by you or a 3rd party?

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Apologies for not being very clear.

1. I am trying to view the report through application created by me. When I click on "Export this report" button, and select format (rpt or pdf or else) and click export, the URL gets changed to below and I get a blank screen.

http://localhost:9080/CrystalReportViewerHandler

2. For reports which have more than 1 page, when I click on "Go to Next Page" button, a pop up is displayed with below message

"The viewer is unable to connect with the CrystalReportViewerServlet that handles asynchronous requests. Please ensure that the Servlet and Servlet-Mapping have been properly declared in the application’s web.xml file"

Suggestion is highly appreciated.

former_member183750
Active Contributor
0 Kudos

Re. 1. What code is implemented under that button?

R2. 2. Very typical in a web app if the report is not in session. Pretty well any action on the report viewer causes postbacks, certainly paging will, and if the report is not in session, you will get issues much like what you are seeing. For more info see KBA:

1985571 - How to use sessions in web applications using the Crystal Reports viewer (the complete cod...

Also, see KBA 1664415. Search box is in top right corner.

- Ludek

Former Member
0 Kudos

Hi Ludek,

Apologies for late reply.

PFA, the screenshots.

I am not very sure, what code is implemented under the buttons, as it's inbuilt in crystal reports setup.

I have gone through the mentioned KBAs but those seem to be for Dotnet where as my application is on Java.

I have missed to inform an important thing. My application was using CRXI and we didnt face any issue there. Just after we migrated to CR2011, these issues are being faced.

Any input is highly appreciated.

former_member183750
Active Contributor
0 Kudos

So, there are actually two important pieces of info you just provided:

1) my application is on Java

2) My application was using CRXI and we didnt face any issue there. Just after we migrated to CR2011

Pretty significant omissions(?)...

Reason I gave you info pertaining to .NET is because you posted your query to the CR for .NET forum...

In any case. CR 2011 does not instal any SDK, so I am not sure how that would affect your application, It should still be using CR XI jar files(?).

I am also moving the Discussion to the CR for Java forum.

- Ludek

Message was edited by: Ludek Uher

Former Member
0 Kudos

From the information you provided, it seems you are viewing unmanged reports form your java app.

You would need to update your runtimes and use crystal reports for eclipse runtimes from the below link

http://scn.sap.com/docs/DOC-29757

Download 'SAP Crystal Reports for Java runtime components - Java Reporting Component (JRC) (45 MB)'

The download will contain the jar files and supporting crystalreportviewer components.

Update your application with the new jars as well as the crystalreportviewers folder.

Crosscheck your mappings in web.xml and test your application.

Thanks,

Prithvi

Former Member
0 Kudos

Hi,

We had already downloaded the jars and crystalreportviewers folder. We were using the same in our application. As suggested, we downloaded again today from the link provided.

But, we are still facing the same issue. None of the navigation buttons are working.

I guess it could be something related to web.xml.

Please suggest.

Former Member
0 Kudos

Use the below entries for your web.xml

<context-param>

  <param-name>crystal_image_uri</param-name>

  <param-value>crystalreportviewers</param-value>

  </context-param>

<context-param>

  <param-name>crystal_image_use_relative</param-name>

  <param-value>webapp</param-value>

  </context-param>

<servlet>

  <servlet-name>CrystalReportViewerServlet</servlet-name>

  <servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>

  </servlet>

<servlet-mapping>

  <servlet-name>CrystalReportViewerServlet</servlet-name>

  <url-pattern>/CrystalReportViewerHandler</url-pattern>

  </servlet-mapping>

Thanks,

Prithvi

Former Member
0 Kudos

Dear,

After making the suggested web.xml changes, we were not even able to view the reports. We were getting the below error:

The viewer was unable to find the resources required to render the report.
Please check the following to resolve the issue.
1. Verify that ../../crystalreportviewers/ is accessible to your WebApp and is the correct path to the viewer resources.
2. You may customize this location by altering the crystal_image_uri and crystal_image_use_relative properties in the web.xml.
3. Validate that the file crv.js exists at ../../crystalreportviewers/js/crviewer/crv.js.

We then changed the value of crystal_image_use_relative. Instead of "webapp", we gave the name of our web application as the value. After that we are able to view
the report, but still facing original issues (below 2 issues)
1. On click of Download button, the URL gets changed to below and we get a blank screen.
http://localhost:9080/CrystalReportViewerHandler
2. For reports which have more than 1 page, on click on “Next” button, it’s not proceeding to next page. Instead a pop message is displayed to the user as below:
“The viewer is unable to connect with the CrystalReportViewerServlet that handles asynchronous requests. Please ensure that the Servlet and Servlet-Mapping have been properly declared in the application’s web.xml file”

Just for your information, the jsp (from which we which we are calling reports) is not present in root level of our Web applicaiton. It is present under
2 folders from root level of our Web applicaiton.

We didnt face any such issues in CR XI.
Please help us in solving this.

Regards,

Former Member
0 Kudos

Hi Friend,

Did you manage to fix this issue? I'm also facing same issue here.

Using crjava-runtime_12.2.218.jar inside my JavaEE Struts Application. Managed to display the reports using ReportViewer jsp. However in a report with pagination, when I click next page an alert box showing this message


The viewer is unable to connect with the CrystalReportViewerServlet that handles asynchronous requests. Please ensure that the Servlet and Servlet-Mapping have been properly declared in the application’s web.xml file

ReportViewer location:


Webcontent

     + crystalreportviewers

     + common

          + reports

               - ReportViewer.jsp

web.xml


<context-param>

        <param-name>crystal_document_view</param-name>

        <param-value>weblayout</param-value>

    </context-param>

    <context-param>

         <param-name>crystal_image_uri</param-name>

         <param-value>MyWebApp/crystalreportviewers</param-value>

    </context-param>

    <context-param>

        <param-name>crystal_image_use_relative</param-name>

        <param-value>webapp</param-value>

    </context-param>

<servlet>

          <display-name>CrystalReportViewerServlet</display-name>  

          <servlet-name>CrystalReportViewerServlet</servlet-name>

          <servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>

    </servlet>

<servlet-mapping>

        <servlet-name>CrystalReportViewerServlet</servlet-name>

        <url-pattern>/CrystalReportViewerHandler</url-pattern>

    </servlet-mapping>

ReportViewer jsp


<%@ page import = "com.crystaldecisions.report.web.viewer.*"%>

<%@ page import = "com.crystaldecisions.sdk.occa.report.data.*"%>

<%@ page import = "com.crystaldecisions.sdk.occa.report.data.*"%>

<html>

<body>

<div><p class="errortext"><html:errors property="error_msg"/></p></div>  

<logic:notEqual name="displayType" value="displayErr">

<%

     CrystalReportViewer viewer = new CrystalReportViewer();

  

     viewer.setName("Pending Report");

  

    //Enable Active-X print mode.

    viewer.setPrintMode(CrPrintMode.PDF);

    //Obtain report source of the report that the viewer will display.  

    Object reportSource = session.getAttribute("pendingReport");

    viewer.setReportSource(reportSource);

 

    Fields fields = (Fields) session.getAttribute("fields");

    viewer.setParameterFields(fields);

    viewer.setHasLogo(false);  

    viewer.setOwnPage(true);

    viewer.setDisplayGroupTree(false);

    viewer.setEnableDrillDown(true);   

  

    viewer.setBestFitPage(true);

    viewer.setURI("ReportActionClass.do?do=getPendingReport");

    viewer.setHasToggleGroupTreeButton(false);

     viewer.setHasViewList(false);

    viewer.setReuseParameterValuesOnRefresh(true);

    viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);

%>

</logic:notEqual>

</body>

</html>

Any solution?

Thanks.

Former Member
0 Kudos

Hi,

Problem resolved if i move my report viewer jsp file to the same level as 'crystalreportviewers' folder and change context-param.

Report viewer location:


Webcontent

       + crystalreportviewers

       - ReportViewer.jsp

context param:


<context-param>

         <param-name>crystal_image_uri</param-name>

         <param-value>MyWebApp/crystalreportviewers</param-value>

    </context-param>

But I'm in the process of upgrading cr4je 11 to 12. I don't have these kind of issues in version 11. Moreover we have many reports at different folder levels.

Is this known issue in version 12? Are there any workarounds available?

Thanks,

Suresh