This topic describes how to connect Hologres, a real-time data warehouse, to FineReport to visualize and analyze data.
Prerequisites
-
You have an active Hologres instance. For details, see Purchase a Hologres instance.
-
Go to the FanRuan official website, select a Solution based on your project requirements, and download the client tool. This example uses FineReport.
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
-
Open the FineReport client. In the top menu bar, choose .
-
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/postgresusername
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
-
Click Test Connection. If a dialog box appears with the message Connection Successful, the connection is successful.
NoteIf 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.
-
Click OK to complete the configuration.
-
Visualize and analyze data.
After connecting Hologres to the FineReport client, you can visualize and analyze data. For details, see the official FineReport documentation.
NoteFineReport 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.
-
Open the FineReport client. In the top menu bar, click and select a column chart.
-
In the left-side navigation pane, under Template Dataset, create a DB Query.
-
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;.NoteExternal 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.
-
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.
-
After configuring the chart data, click the Save icon
in the upper-left corner of the menu bar. -
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.
-