Chapter 4. Getting Started

This chapter describes the steps necessary to start creating your own reports. JasperReports report definition files are stored using jrxml extension. For backward compatibility, the xml extension is also supported, but the jrxml extension should be preferred.

4.1. Creating New Report

JasperAssistant provides an Eclipse perspective dedicated to report development. This perspective provides an optimal layout for your Eclipse Workbench and includes all the views required while working with JasperAssistant. To open the JasperAssistant perspective select the following option from the the Eclipse menu:

Window->Open Perspective->Other...->JasperAssistant

Before creating your first report, ensure that you have at least one project created. To create a project select File->New->Project... from the menu.

To create a new report, use the provided report wizard that will help you start. To open the report wizard choose File->New->Other... from the menu and then select JasperAssistant->Report from the wizard selection dialog.

Figure 4.1. Report creation wizard

Report creation wizard

Tip

A report can also be created by using an existing template. JasperAssistant does not yet provide standard templates but you still can create your own skeleton reports and reuse them later as templates. To create a new report from a template, simply copy the template file to a new file you wish to use for your report.

Procedure 4.1. New report wizard steps

  1. File name selection

    First step requires you to specify the name of the file and its location. The report can be created directly from this step by choosing Finish.

  2. Data source selection

    This step allows you to select a data source from the list of configured data sources (Section 3.2, “Data Sources”). Selecting a database type data source activates the Next button. Selecting a custom type data source such as bean array based data source, also activates this button. The report creation can be finished directly from this step by choosing Finish.

  3. SQL query specification

    This step is available only for database type data sources. It allows you to specify the SQL query that will supply the data for the report. For other data source types this step is skipped. Enter the query and press Next button to proceed to the next step. If you do not wish to enter the SQL query at this point, choose the Finish button to create the report.

  4. Field selection

    This step allows you to select the data source fields for the report. After selecting the desired fields, choose the Finish button to create the report.