Report Builder

The Report Builder is a tool to create your own database reports. Unlike with the Report Wizard, using the Report Builder you can take control to design the report the way you want. The generated report is a Writer document that you can edit, too.

note

To use the Report Builder, the Java Runtime Environment (JRE) software must be installed, and this software must be selected in LibreOffice.


To install the JRE software

The Report Builder requires an installed Java Runtime Environment (JRE).

  1. Choose - LibreOffice - Advanced.

  2. Wait up to one minute, while LibreOffice collects information on installed Java software on your system.

    If a recent JRE version is found on your system, you see an entry in the list.

  3. Click the option button in front of the entry to enable this JRE version for use in LibreOffice.

  4. Ensure that Use a Java runtime environment is enabled.

If no JRE version is found on your system, open your web browser and download the JRE software from http://www.java.com. Install the JRE software. Then restart LibreOffice and open - LibreOffice - Advanced again.

To open the Report Builder

  1. Open a Base file or create a new database. The database must contain at least one table with at least one data field and a primary key field.

  2. Click the Reports icon in the Base window, then choose Create Report in Design View.

    The Report Builder window opens.

The Report Builder is divided into three parts. On the top you see the menu, with the toolbars below.

On the right you see the Properties window with the property values of the currently selected object.

The left part of the Report Builder window shows the Report Builder view. The Report Builder view is initially divided into three sections, from top to bottom:

  1. Page Header - drag control fields with fixed text into the Page Header area

  2. Detail - drag and drop database fields into the Detail area

  3. Page Footer - drag control fields with fixed text into the Page Footer area

To insert an additional Report Header and Report Footer area choose Edit - Insert Report Header/Footer. These areas contain text that appears at the start and end of the whole report.

Click the "-" icon in front of an area name to collapse that area to one line in the Report Builder view. The "-" icon changes to a "+" icon, and you can click this to expand the area again.

You insert database fields by drag-and-drop into the Detail area. See the section "To insert fields into the report" below.

In addition, you can click the Label Field or Text Box icon in the toolbar, then drag a rectangle in the Page Header or Page Footer area, to define a text that is the same on all pages. You enter the text in the Label box of the corresponding Properties window. You can also add graphics by using the Graphics icon.

To connect the report to a database table

  1. Move the mouse to the Properties view. You see two tab pages General and Data.

  2. On the Data tab page, click Content to open the combo box.

  3. Select the table for that you want to create the report.

  4. After selecting the table, press the Tab key to leave the Content box.

The Add fields to report window opens automatically and shows all fields of the selected table.

Felder zum Bericht hinzufügen

Das Fenster „Feld hinzufügen“ hilft Ihnen, Tabelleneinträge in einen Bericht einzufügen.

After inserting fields in the Detail view, the report is ready for execution.

To execute a report

Click the Execute Report icon on the toolbar.

Execute Report icon

Execute Report icon

A Writer document opens and shows the report you have created, which contains all values of the database table which you have insert.

If the database contents did change, execute the report again to update the result report.

To edit a report

First decide if you want to edit the generated report, which is a static Writer document, or if you want to edit the Report Builder view and then generate a new report based on the new design.

The Writer document is opened read-only. To edit the Writer document, click Edit Document on the information bar, or choose Edit - Edit Mode.

If you want to edit the Report Builder view, you can change some of its properties.

Click in the Details area. Then in the Properties window, change some properties, for example the background color.

After finishing, click the Execute Report icon to create a new report.

Execute Report icon

Execute Report icon

If you close the Report Builder, you will be asked if the report should be saved. Click Yes, give the report a name, and click OK.

Sorting the report

Ohne Sortierung oder Gruppierung werden die Datensätze in der Reihenfolge in den Bericht eingefügt, in der sie aus der Datenbank abgerufen werden.

  1. Öffnen Sie die Ansicht Berichtdesigner und klicken Sie in der Symbolleiste auf das Symbol Sortieren und Gruppieren. Sie sehen den Dialog Sortieren und Gruppieren.

Symbol für Sortieren und Gruppieren

Symbol „Sortieren und Gruppieren“

  1. Klicken Sie im Feld „Gruppen“ auf das Feld, das Sie als erstes Sortierfeld verwenden möchten, und legen Sie die Sortiereigenschaft fest.

  2. Führen Sie den Bericht aus.

Gruppierung

  1. Öffnen Sie die Ansicht Berichtdesigner und klicken Sie in der Symbolleiste auf das Symbol „Sortieren und Gruppieren“. Sie sehen den Dialog Sortieren und Gruppieren.

  2. Öffnen Sie im Feld „Gruppen“ das Listenfeld „Gruppenkopfzeile“ und wählen Sie aus, dass eine Gruppenkopfzeile angezeigt werden soll.

  3. Klicken Sie auf das Symbol »Feld hinzufügen«, um das Fenster „Feld hinzufügen“ zu öffnen.

Symbol für Feld hinzufügen

Symbol „Feld hinzufügen“

  1. Ziehen Sie den Feldeintrag, den Sie gruppieren möchten, per Ziehen-und-Ablegen in den Gruppenkopfbereich. Ziehen Sie dann die verbleibenden Felder per Ziehen-und-Ablegen in den Detailbereich.

  2. Führen Sie den Bericht aus. Der Bericht zeigt die gruppierten Datensätze.

Wenn Sie sortieren und gruppieren möchten, öffnen Sie die Ansicht Berichtdesigner und dann den Dialog „Sortieren und Gruppieren“. Wählen Sie diese Option aus, um eine Gruppenkopfzeile für die Felder anzuzeigen, die Sie gruppieren möchten, und, um die Gruppenkopfzeile für die Felder auszublenden, die Sie sortieren möchten. Schließen Sie das Fenster „Sortieren und Gruppieren“ und führen Sie den Bericht aus.

Aktualisieren und Drucken Ihrer Daten

Wenn Sie neue Daten einfügen oder Daten in der Tabelle bearbeiten, zeigt ein neuer Bericht die aktualisierten Daten.

Klicken Sie auf das Symbol „Berichte“ und doppelklicken Sie auf Ihren zuletzt gespeicherten Bericht. Es wird ein neues Writer-Dokument erstellt, das die neuen Daten anzeigt.

Symbol für Berichte

Symbol „Berichte“

Um einen Bericht zu drucken, wählen Sie im Writer-Dokument Datei – Drucken…