• Post Reply Bookmark Topic Watch Topic
  • New Topic

.jrxml file through the jsp  RSS feed

 
Anand Suryavanshi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to call or run the .jrxml file through the jsp
or
i wanat to pass the query to the jasper report run time.
or
i want to create report depending upon the textfield of that web-page through database.


or

i tred this is following code but its gives th error
code:-
<%@ page langauage="java" %>
<%@ page import="net.sf.jasperreport.engine.*" %>
<%@ page import="net.sf.jasperreport.engine.util.*" %>
<%@ page import="net.sf.jasperreport.engine.export" %>
<%@ page import="net.sf.jasperreport.engine.JREmptyDataSource" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.text.*" %>
<%
JasperPrint jasperPrint;
String path=getServletContext().getRealPath();
JasperReport jasperReport=JasperCompilerManager.compileReport("C://apache-tomcat-6.0.16//webapps//ROOT//Emp//report/"+sample+".jrxml");
Map parameters=null;

Class.forName("org.postgresql.Driver");
Connection con=DriverManager.getConnection("jdbc:postgresql://localhost:5433/master/","postgres","a*n$and");

String dest="C:/apache-tomcat-6.0.16/webapps/ROOT/Emp/report/"+sample+".html"
jasperPrint=JasperFillManager.fillReport(jasperReport, new HashMap(),con);
JasperExportManager.exportReportToHtmlFile(jasperPrint, dest);
%>
<jsp:forword page='<%="/"+sample+".html"%>'/>

error:=
pe Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /Emp/report/rept.jsp(23,5) Invalid standard action
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1163)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1455)
org.apache.jasper.compiler.Parser.parse(Parser.java:133)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:153)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!