Create a Web report using the MyEclipse report (top)

Source: Internet
Author: User

Well-organized business data can significantly improve critical decision-making processes. Use the MyEclipse Reports tool to develop a variety of web reports. In this tutorial, you will learn to:

    • Create a report Web project and data source
    • Create, layout, and format a report
    • Create a data set
    • Sort report Data
    • Deploy and test report projects

Duration: 30 minutes

No myeclipse? Download Now

1. Create a report Web project

There are two ways to create a report Web project. The first method is to use the Report Wizard to create a new project, and the second is to add the report Web Runtime facet to an existing MyEclipse Web project.

Note : MyEclipse Standard users cannot use the reporting feature.

1.1 Create a new report Web project

(1) Select File>new>report Web Project.

(2) Enter Reportdemo in the Project Name field, and then click Next.

Note : This tutorial uses the default Java EE 6 version; However, it is also possible to create a new project that is Java EE 7.

To create a new report Web project

(3) Configure the project folder structure, and then click Next.

Project folder configuration

(4) Change or accept the Default Web Module folder name, and then click Next.

Set the folder name for the Web module

(5) Configure deployment settings, specify the logging level for the report engine, and then click Finish.

Specify the report engine's logging level report project structure1.2 Adding a report Web Runtime facet to an existing Web project

You can install the report Web Runtime facet into any existing MyEclipse Web project.

(1) Right-click the project and select Myeclipse>project facets>install myeclipse report Web Runtime Facet.

Add report Web Runtime facet

(2) Complete the wizard and click Finish to update the project.

When the wizard closes, you will be prompted to open the MyEclipse report Design view, at which point select Yes. Otherwise, you can open the view only by selecting Window>open Perspective>other and then selecting MyEclipse Report Design.

2. Create a report

(1) Select the reportdemo project and select File>new>report. (Report toolbar options appear when you use MyEclipse reports Design perspective)

(2) Enter D emo_report.rptdesign in the File Name field. the report name extension should be named . Rptdesign.

(3) Check the page options for generating report access, and then click Next.

Select Project Report

(4) Select a blank report from the list of templates and click Next.

Select a report template

Next page, you can create a sample JSP Web page to demonstrate how to work with the new report. Sample JSP pages for samples can be properly configured with a link to your report, or embedded directly in the report.

Note : If you do not choose to generate a sample report access page at this time, you can do so at any time by right-clicking the report and selecting Myeclipse>generate. webpage.

(5) Use the default folder location and enter demo_report.jsp as the JSP file name.

(6) Select the embedded Report Viewer [JSP Tag] option and click Finish.

Page Options for report access

(7) Create a JDBC data source for retrieving report data, which uses tables from the MyEclipse Derby database.

3. Create a data set

A data group is a collection of data retrieved from a data source. This data will be displayed in a report, in this example, using the SQL data source.

(1) In Data Explorer, right-click the dataset and select New data set.

To create a new data set

(2) Select the data source that you created in the previous section.

(3) Accept the default MyEclipse SQL Select query DataSet type.

(4) Enter Customersin the DataSet Name field, and then click Next.

Select a data source

(5) Enter the following SQL query and click Finish to execute the SQL query and create the dataset.

Select CUSTOMERNAME, Contactfirstname, Contactlastname, PHONE

From Classiccars. CUSTOMER

DataSet Query Editor

Retrieves data for the SQL query of the dataset. When you enter an SQL query, the Query Editor provides content-assisted schema and table names. You can also double-click a table or column in the tree view and insert the qualified name of the query at the end of the edit.

If there is no problem creating the dataset, open the Edit DataSet window and let you further customize the dataset. Select Preview results to display the data results for the SQL query.

Data Set Editor4. Make a report

The next step is to add the user interface elements to the report to display the data from the customers data set. You can insert report elements into the Report Designer by right-clicking the Reports page, and then selecting an item from the Insert menu. Or use palette in the palette view. The label at the bottom of the Report Designer allows you to switch views.

Report Designer

First, the report uses palette to add table elements. Then, you bind the column from the column collection element of the report's datasheet. It is important to understand the table function:

    • The table iterates through the datasets of all the data rows.
    • It enables you to easily layout data in a row and column format.

(1) Open palette to view the report elements.

Palette View

(2) Drag a TABLE element from the palette and place it in the editor's report.

(3) Specify 3 columns, 1 rows, and then click Next.

Create a new table

(4) Select customers from the drop-down list in the dataset, click Choose All, and click Finish. The 3 columns and 1 rows of the table appear in the editor.

Binding a data set

(5) In Data Explorer, expand the customers dataset to see the columns that you specified in the query.

(6) Drag the CustomerName column from the data resource browser and place it in the first cell of the detailed row to bind the dataset element of the table column.

The detailed rows in the table define the columns of the dataset and the order in which each row of data in the table is displayed. In a completed report, each row of data in the detail column is duplicated in the data set.

Drag a DataSet column and drop it into a table cell

When the CUSTOMERNAME list is dragged from the dataset to the detail row, the [CUSTOMERNAME] data binding element is added to the layout editor. In addition to the header row above the new [CUSTOMERNAME] data element, the layout editor adds a column header label, such as CUSTOMERNAME.

Data and label features in a table

(7) Drag and drop the phone column in the second cell of the detail row.

(8) Drag and drop the Contactfirstname column in the third cell of the detail row.

(9) Drag-and-drop contactlastname is listed in the third cell of the detail row, and the following is Contactfirstname.

The layout of the report should resemble the following.

Add the customer contact information to the table

(10) To confirm that the data and table layout for the report is correct, click the Preview option at the bottom of the reporting designer.

Previewing report data

MyEclipse official Chinese online line, welcome to download Communication!

Create a Web report using the MyEclipse report (top)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.