Example: Use of LibreOffice Base as Reporting Tool
2017 R1 Update Rollup 1

Example: Use of LibreOffice Base as Reporting ToolPermanent link for this heading

LibreOffice Base connected to a PostgreSQL database can be used as reporting tool. This section describes how to configure the connection.

Microsoft Windows EnvironmentPermanent link for this heading

To connect from LibreOffice Base to a PostgreSQL database the PostgreSQL ODBC driver is required. This driver can be downloaded from http://www.postgresql.org/ftp/odbc/versions/dll/.

Install PostgreSQL ODBC DriverPermanent link for this heading

To install the PostgreSQL ODBC driver, perform the following steps:

  1. Click “Start” > “Run” and enter odbcad32 to start the ODBC data source administration tool.
  2. Click “OK”.
  3. On the “System-DSN” tab click “Add”.
  4. Select the “PostgreSQL Unicode” driver and click “Finish”.
  5. Define the database connection.
  6. Click “OK”.

Connect from LibreOffice Base to the DatabasePermanent link for this heading

To connect from LibreOffice to a PostgreSQL database, perform the following steps:

  1. Start LibreOffice Base.
  2. In the LibreOffice Database Wizard select “Connect to an existing database” and “ODBC”. Click “Next”.
  3. Define the ODBC connection. Therefore click “Browse”.
  4. Select the PostgreSQL ODBC driver installed before. Click “OK”.
  5. Click “Next”.
  6. Select “Yes, register the database for me” and “Open the database for editing”. Afterwards click “Finish”.

    LibreOffice Base is started and queries and reports can be created.

Linux EnvironmentPermanent link for this heading

In a Linux environment the connection from LibreOffice Base to PostgreSQL should be realized with JDBC. The PostgreSQL JDBC driver can be downloaded from http://jdbc.postgresql.org/download.html. The download version depends on the version of Java Runtime Environment (JRE) that is used by LibreOffice and on the version of PostgreSQL.

Define the Java Runtime Environment Used by LibreOfficePermanent link for this heading

To define the Java Runtime Environment used by LibreOffice, perform following steps:

  1. Start the LibreOffice Writer.
  2. Select “Tools“ > “Options“.
  3. Navigate to “LibreOffice” > “Java”, if you want to add further Java Runtime Environment versions.
  4. Depending on the selected Java Runtime Environment version download the corresponding PostgreSQL JDBC driver.
  5. Click “Class Path” to add the new driver.
  6. Click “Add Archive” and select the driver.
  7. Confirm all dialog boxes and close LibreOffice Base. Verify that no LibreOffice process is running.

Connect from LibreOffice Base to the DatabasePermanent link for this heading

To connect from LibreOffice to a PostgreSQL database, perform the following steps:

  1. Start LibreOffice Base.
  2. In the LibreOffice Database Wizard select “Connect to an existing database” and “JDBC”. Click “Next”.
  3. Enter the data source URL and the JDBC driver class.
    The data source URL has the following syntax:
    jdbc: postgresql://<fqdn of databaseserver>:<port>/<name of reporting database>
    Note: The port need not to be set if the default port (5432) is used.
    The JDBC driver class is named org.postgresql.Driver.
    Note: With the “Test class” button the settings can be tested.
  4. Click “Next”.
  5. Enter user credentials and click “Finish”.
  6. LibreOffice Base is started and queries and reports can be created.