FineReport

更新时间:
复制 MD 格式

This topic describes how to connect Hologres, a real-time data warehouse, to FineReport to visualize and analyze data.

Prerequisites

Background information

FineReport is a professional, flexible, and easy-to-use enterprise web reporting software. It lets you design complex China-style reports, parameterized query reports, data entry forms, and dashboards with simple drag-and-drop operations to easily build a data-driven decision analysis system.

Procedure

  1. Open the FineReport client. In the top menu bar, choose Server > Define Data Connection.

  2. In the Define Data Connection dialog box, configure the parameters.

    The following table describes the parameters.

    Parameter

    Description

    Example

    database

    The name of the database in your Hologres instance.

    testdb

    driver

    Use the built-in driver of FineReport: org.postgresql.Driver.

    A driver is automatically generated after you add a database in FineReport.

    None

    URL

    The public URL of the Hologres instance. The format is jdbc:postgresql://<Endpoint>:<Port>/<DatabaseName>.

    jdbc:postgresql://demo-cn-hangzhou.hologres.aliyuncs.com:80/postgres

    username

    The AccessKey ID of your Alibaba Cloud account.

    You can go to the AccessKey Management page to obtain the AccessKey ID.

    None

    password

    The AccessKey Secret of your Alibaba Cloud account.

    You can go to the AccessKey Management page to obtain the AccessKey Secret.

    None

  3. Click Test Connection. If a dialog box appears with the message Connection Successful, the connection is successful.

    Note

    If the connection fails, check if the PostgreSQL driver is installed. For more information, see the official driver installation guide. Also, ensure you use a JDBC driver of version 42.2.18 or later.

  4. Click OK to complete the configuration.

  5. Visualize and analyze data.

    After connecting Hologres to the FineReport client, you can visualize and analyze data. For details, see the official FineReport documentation.

    Note

    FineReport lets you query external tables in Hologres for visual analysis. However, when you add a new dataset, external tables are not displayed. You must use SQL statements to query them.

    This example shows how to create a column chart using data from a Hologres external table.

    1. Open the FineReport client. In the top menu bar, click File > New Dashboard and select a column chart.

    2. In the left-side navigation pane, under Template Dataset, create a DB Query.

    3. In the DB Query dialog box, enter the SQL statement to query the data and click OK. This example queries 200 rows of data from a Hologres external table. The SQL statement is select * from bank limit 200;.

      Note

      External tables of the current Hologres data source do not appear in the left-side navigation pane of the DB Query page. You can query an external table directly in the editor on the right.

    4. After configuring the DB Query, return to the chart page to configure its data.

      In this example, on the Data tab in the right-side pane, configure the chart's axes. Set the category axis to the job data and the value axis to the age data. You can also configure the chart's Style and Special Effect. For Data Source, select Dataset data. For Dataset, select ds1.

    5. After configuring the chart data, click the Save icon 保存 in the upper-left corner of the menu bar.

    6. Click the Preview icon 预览 to view the chart.

      The following figure shows the chart created using data from the Hologres external table.结果展示 For more information about FineReport operations, see the official FineReport website.