Results 1 to 3 of 3
  1. #1
    str_ardi_per is offline Member
    Join Date
    Dec 2008
    Posts
    1
    Rep Power
    0

    Default Jsp + Ireport Question

    PLESASE TELL ME ABOUT ERROR????

    <%@ page import="net.sf.jasperreports.engine.*" %>
    <%@ page import="net.sf.jasperreports.engine.design.*" %>
    <%@ page import="net.sf.jasperreports.view.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>

    <html>
    <head>
    <title>Welcome</title>
    </head>
    <body>
    <center>Welcome</center>

    <%
    try{
    JasperReport jReport=null;
    JasperPrint jPrint=null;
    JasperDesign jDesign;
    Connection conn;
    Statement stmt;
    ResultSet rs;

    Class.forName("com.mysql.jdbc.Driver");
    conn = DriverManager.getConnection("jdbc:mysql://localhost:/tes","root","");

    out.println("koneksi ok <BR>");

    jReport = JasperCompileManager.compileReport("test.jrxml");
    jPrint = JasperFillManager.fillReport(jReport,new HashMap(),conn);
    JasperViewer.viewReport(jPrint);
    }
    catch (Throwable t)
    {
    out.println(t.getMessage());
    }
    %>

    </body>
    </html>

    OUTPUT:

    connection ok
    test.jxrml ( The system cannot find the file specified ) :(

    PLESASE TELL ME ABOUT ERROR????

  2. #2
    nnbb is offline Member
    Join Date
    Dec 2008
    Location
    Montevideo,UY
    Posts
    2
    Rep Power
    0

    Default

    Please check the path of this file "test.jrxml" its seems that the path is wrong.

    Im using the ".jasper" file to load the report. This is a little example of my code:
    File f = new File("package/abc.jasper");
    JasperReport jReport = JasperManager.loadReport(f.getAbsolutePath());
    JasperPrint jPrint = JasperManager.fillReport(template,null,conn);
    JRViewer jrv = new JRViewer(jPrint);

    I hope that this example can help you.
    Regards,
    nnbb.-

  3. #3
    nnbb is offline Member
    Join Date
    Dec 2008
    Location
    Montevideo,UY
    Posts
    2
    Rep Power
    0

    Default

    Sorry thiss the correct line:

    JasperPrint jPrint = JasperManager.fillReport(jReport,null,conn);

Similar Threads

  1. iReport
    By Freddie in forum Advanced Java
    Replies: 6
    Last Post: 04-20-2010, 07:25 PM
  2. iReport Chart
    By rose_mary in forum Other IDEs
    Replies: 0
    Last Post: 12-09-2008, 06:17 PM
  3. jsp and ireport
    By sbuggle in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-25-2008, 10:25 AM
  4. duplicates in iReport
    By Heather in forum Advanced Java
    Replies: 1
    Last Post: 07-05-2007, 05:42 AM
  5. Eclipse+ireport
    By Nick15 in forum Eclipse
    Replies: 2
    Last Post: 05-14-2007, 05:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •