Joke Collection Website - Mood Talk - Tell me how to use Jaspersoft Studio to design your first report

Tell me how to use Jaspersoft Studio to design your first report

1. Select the report template

File -gt; New -gt; Jasper Report, open the report template selection box:

Jaspersoft Studio has some built-in report templates For us to choose, we can also customize our own report template O(∩_∩)O~

Here we select Coffee template, and then click Next.

2. Name the new report file and specify the path to place it:

Click Next.

3. Select the data source:

In the Data Adapter, some data sources have been pre-installed:

Here we choose Sample DB - Database JDBC Connection, Then in the box on the right, enter the SQL statement:

Click Next.

4. Select the display fields:

The SQL statement just written will be executed here, and all the fields obtained will be listed in the list on the left for selection. The selection here needs to be done in the report Fields displayed in (you can double-click to select or use the button in the middle):

After selecting, click Next, you will jump to the group field selection. This feature will not be listed for now, and will be discussed later, so here it is directly Click Next and finally click Finish.

At this point, the fields required for our first report have been added successfully:

Click the project name in Outline -> Click Edit query, filter and sort options in Properties:

In the opened data source and query dialog box, click Read Fields on the upper right to read more fields:

Note: You can also modify the SQL statement here to get new fields. Fields, but if the existing fields in the report do not exist in the new field set, these old fields must be deleted manually!

After clicking OK, the new field set is configured and they will be listed in Fields of Outline for use:

In design mode, click on the field to be deleted Field, press Delete to delete it directly O(∩_∩)O~

Click the preview tab to see the effect:

Note: Sub-report and parent report They are saved in their own files, so if you modify or save the parent report that contains the subreport, it will not affect the subreport! If you want to save the parent-child report at once, you can check Build Automatically in Projects -gt;

File -gt; New -gt; Project, type "Jasper" in Wizards (filter out relevant content):

Select JasperReports Project, and then in the next dialog box Enter the project name in , click Finish, and the project folder will be created.

In the Project Explorer on the left side of the main interface, you can see the project folder we just added: