Hyperlink Option :
Before working on the Integration of Crystal reports with JSP, be sure that you have set up the server correctly :
A Web Server (Apache, IIS, etc.)
A JSP Server (Tomcat, Jrun, etc.)
Seagate Page Server
Seagate Web Component Server
A Database Server (optional)
What do we want to achieve ?
Open a Sample.rpt report using JSP.
Passing parameters into report using JSP
In most of the cases ,we will see that the JSP Page lies on some other server ;whereas the reports that have to be fetched are available on the different server. Then,how will our Server recognize that a call made for the report lies on the different server? It can be noticed that the servers will be addressed by different port numbers.So,for example our JSP page is called using Port:80 ;then our reports can be invoked using Port :8080.This point can be clearly seen in our example as we have referred to :
http://servername:8080/report.rpt
OPEN SAMPLE.RPT REPORT USING JSP : Here, is a Sample Code(Sample.jsp). Here,we are trying to call a report report.rpt from within a JSP page. You can have some piece of code prior or after the <A>..</A> tag.You will also notice the use of init=java .It indicated that we are trying to call the report on the browser using the Java Viewer.
<HTML>
<HEAD>
<TITLE> CALLING REPORT WITHIN A JSP PAGE WITH SAVED DATA </TITLE>
</HEAD>
<BODY>
<A HREF = "
http://servername:8080/report.rpt?init=java">Report</A>
</BODY>
</HTML>
}
PASSING PARAMETERS INTO REPORT USING JSP : Here, is a Sample Code(Sample.jsp). Here,we are trying to call a report report.rpt from within a JSP page. You can have some piece of code prior or after the <A>..</A> tag.The two parameter values ,namely,FirstParameterValue and the SecondParameterValue are the name of the fields in an HTML form .
<HTML>
<HEAD>
<TITLE> CALLING REPORT WITHIN A JSP PAGE WHERE USERS PASS PARAMETERS TO THE REPORT </TITLE>
</HEAD>
<BODY>
<A HREF ="
http://servername:8080/report.rpt?init=java&prompt0=<% request.getParameter
("FirstParameterValue")%>&prompt1=<%=request.getParameter("SecondParameterValue")%>">
Report</A>
</BODY>
</HTML>