Skip to Content
0
Former Member
Apr 29, 2009 at 06:43 AM

Errors in creating Crystal Report

90 Views

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.