Using the JasperReports Framework in Visual Web Applications to Generate PDF and HTML Reports

We just posted the http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/reports.html tutorial to the Sun Java Studio Creator Tutorials web site. This tutorial works for the Visual Web Pack with the following changes.

  • Throughout
    • The source is in src/java instead of just src.
  • Creating a JasperReports Library
    • Step 3: the library type is "Class Libraries"
    • For the Sun Java System Application Server, you must also add the commons-beanutils, commons-collections, and commons-logging jars to the library.
  • Setting Up the JRXML Editing Environment
    • Step 2: Click Advanced Options, then expand Options > IDE Configuration > System > Object Types to get to XML Objects.
  • Creating the Project and Authorizing Access to the JasperReport Classes
    • Create a Visual Web Application and use the BluePrints structure.
    • You do not need to do steps 5 through 10 for the Sun Java System Application Server.
  • Creating the Database Query
    • Also clear the LASTEDUPDATED column from each table.
  • Setting Up the Report Resources
    • To add the second source directory for the JRXML files, switch to the Files window.
    • Right-click the project node, and select New > Folder.
    • Set the folder name to reports.
    • Set the parent folder to src (that is, the "src" directory inside the project) so that this node will be parallel to src/java.
    • Click Finish. Note that the directory is only visible on the files view.
    • Right-click the project name, and select Properties.
    • Click Add Folder, navigate to the src/reports node, and click Open.
    • Change the Label from the default (src/newfolder) to something meaningful, such as JasperReports Definitions and click OK.
    • Switch back to the Projects window, and you will see this new node, with a <default package> node underneath it.
    • Put the JRXML files under the <default package> node (that is, into directory src/reports).
Comments:

Post a Comment:
Comments are closed for this entry.
About

divas

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today