cancel
Showing results for 
Search instead for 
Did you mean: 

Errors in creating Crystal Report

Former Member
0 Kudos

Good after to everyone;

Please help me in my problem in creating report in struts. I already added the needed jars but i still had errors. Also I already created my .rpt file and jsp that will call my report.

This is my codes in jsp:

<%@page import="com.crystaldecisions.sdk.occa.report.application.ReportClientDocument" %>

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

<%

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

if(reportSource == null)

{

ReportClientDocument reportClientDoc = new ReportClientDocument();

String report = "/Report/MyFirstReport.rpt";

reportClientDoc.open(report, 0);

reportSource = reportClientDoc.getReportSource();

session.setAttribute("reportSource", reportSource);

}

CrystalReportViewer viewer = new CrystalReportViewer();

viewer.setReportSource(reportSource);

viewer.setOwnPage(true);

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

%>

While running this codes an error occured, this is the error.

Only a type can be imported. com.crystaldecisions.sdk.occa.report.application.ReportClientDocument resolves to a package

Only a type can be imported. com.crystaldecisions.report.web.viewer.CrystalReportViewer resolves to a package

ReportClientDocument cannot be resolved to a type

CrystalReportViewer cannot be resolved to a type

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)

org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)

org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)

org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)

org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)

org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)

org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I would appreciate your help. I am working for days just to fix this errors but i dont have any idea whats the problem. Thank you very much in advance.

Accepted Solutions (1)

Accepted Solutions (1)

ted_ueda
Active Contributor
0 Kudos

Missing webreporting.jar

Sincerely,

Ted Ueda

Former Member
0 Kudos

Hi Ted Ueda,

i already had the webreporting.jar. Do you have any other clue why i am getting this error. Thank you so much for your reply.

ted_ueda
Active Contributor
0 Kudos

That's nice. Where do you have the jars?

You'll note it's not finding either of your imports. In fact, the error message:

> Only a type can be imported. com.crystaldecisions.report.web.viewer.CrystalReportViewer resolves to a package

indicates your web app is pretty much whacked. I suggest you create it again from scratch.

Sincerely,

Ted Ueda

Former Member
0 Kudos

Ted Ueda

i got it in the sample web app codes when i download the Tomcat 5.5. thank you again for your reply

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you all guys...my error is it did not found where the jar that i am using for this program,. make sure the jar you are using is in the right path..thanks to all who reply to me.

Former Member
0 Kudos

Which version of crystal reports are you using?

Are you using any plugin?

Thanks,

Tej

Former Member
0 Kudos

Tej,

i am using a crystal report 2008 that is build in eclipse ganymede. My eclipse version is Eclipse Ganymede 3.4.1 with Crystal Reports for Eclipse. Thank you so much.

Former Member
0 Kudos

Hi,

The problem is that your code is unable to access the two packages, due to which it is unable to get the required files to resolve the respective components, i.e. ReportClientDocument and CrystalReportViewer.

Can you tell me your environment details. i.e.

1>java version

2>jrc version

3>application server and version

4>crystal reports version

Thanks.

Akshara.

Former Member
0 Kudos

hello AksharaP,

Thanks for replying in my thread. This is the detail of my environment.

1 java - jdk1.5.0_08

2 jrc version - i dont think i had this, how can i find out that i had this?

3. application server - tomcat 5.5

4.crystal report version - Eclipse Ganymede 3.4.1 with Crystal Reports for Eclipse

Thank you again for your reply.