Results 1 to 3 of 3

Thread: Jasper Reports, generating temporary file --> test.java

Hybrid View

  1. #1

    Default Jasper Reports, generating temporary file --> test.java

    I’m trying to incorporate Jasper Reports with my current project, and I’m having some trouble using Spring’s Web MVC.

    Here’s what I’ve done so far:

    First I created my “test.jrxml” file using iReports. Copied this file into my “webapp/WEB-INF/” directory. I’ve created a class called “JasperReportsController” which extends “JasperReportsMultiFormatView”. I’m using Eclipse with a Tomcat plugin (4.1.x). I’ve followed the example from springs documentation, section 13.7.3. It seems that whenever I run Tomcat Server, that the “test.java”, temp file, is generated immediately. For some strange reason “test.java” is generated inside the following directory “C:\webarch\eclipse\test.java”, as opposed to my projects location “C:\webarch\projects\%my_project_name%”. This is causing there to be classpath issues, because it can’t seem to see any of the jasper reports library classes. The following is a console snippet of the error:

    C:\webarch\eclipse\test.java:4: package net.sf.jasperreports.engine does not exist
    import net.sf.jasperreports.engine.*;
    ^
    C:\webarch\eclipse\test.java:5: package net.sf.jasperreports.engine.fill does not exist
    import net.sf.jasperreports.engine.fill.*;
    ^
    C:\webarch\eclipse\test.java:14: package net.sf.jasperreports.engine does not exist
    import net.sf.jasperreports.engine.*;
    ^
    C:\webarch\eclipse\test.java:15: package net.sf.jasperreports.engine.data does not exist
    import net.sf.jasperreports.engine.data.*;
    ^
    C:\webarch\eclipse\test.java:21: cannot resolve symbol
    symbol : class JRCalculator
    location: class test
    public class test extends JRCalculator
    ^
    C:\webarch\eclipse\test.java:28: cannot resolve symbol
    symbol : class JRFillParameter
    location: class test
    private JRFillParameter parameter_REPORT_RESOURCE_BUNDLE = null;
    ^
    C:\webarch\eclipse\test.java:29: cannot resolve symbol
    symbol : class JRFillParameter
    location: class test
    private JRFillParameter parameter_REPORT_CONNECTION = null;
    ^
    ………………………
    ………………………
    ………………………

    Are there any suggestions on how I can make this temporary file get generated at least within the projects directory?

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Your controller shouldn't extends JasperReportsMultiFormatView - check out the sample app which can be obtained from CVS. You should also make sure that only version of JasperReports is on the classpath.

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

  3. #3

    Default solution

    Rob thanks for replying. The example actually helped me out with some other issues. But I found out the reason why this file was being generated in the wrong directory. There's a file that the jasper reports library looks for called "jasperreports.properties". There was no documenation on this but you can set a couple of properties here, like the classpath of your referenced libraries and the location of where you wanted temp file to be generated.

    #jasper reports properties
    net.sf.jasperreports.compiler.temp.dir=....
    net.sf.jasperreports.compiler.classpath=....

Similar Threads

  1. Saving large files to a db using hibernate?
    By Dan Washusen in forum Data
    Replies: 10
    Last Post: Sep 20th, 2006, 12:18 PM
  2. Beandoc crashing (on its samples!)
    By aaime in forum Container
    Replies: 17
    Last Post: Oct 7th, 2005, 07:21 AM
  3. Replies: 1
    Last Post: Sep 7th, 2005, 07:00 AM
  4. jasper reports data source definition
    By pinchyTheLobster in forum Web
    Replies: 0
    Last Post: Aug 23rd, 2005, 01:22 PM
  5. Jasper Reports Thread Interruption
    By bhaarathm in forum EJB
    Replies: 4
    Last Post: Oct 5th, 2004, 12:03 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
  •