Rapportbyggjaren

Rapportbyggjaren er eit verktøy for å laga dine eigne databaserapportar. I motsetnad til Rapportvegvisaren, kan du ved hjelp av rapportbyggjaren laga rapporten slik du vil ha han. Den genererte rapporten er eit Writer-dokument som også kan redigerast.

note

For å bruka rapportbyggjaren må programvaren Java Runtime Environment (JRE) vera installert, og denne programvaren må veljast i LibreOffice.


Slik installerer du JRE-programvaren

Rapportbyggjaren krev at Java Runtime Environment (JRE) er installert.

  1. Vel → LibreOffice→ Avansert.

  2. Vent opp til eitt minutt medan LibreOffice samlar informasjon om den installerte Java-programvaren på systemet ditt.

    Viss ein nyare JRE-versjon er funnen i datamaskinen, vil du sjå ei oppføring i lista.

  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.

Den venstre delen av rapportbyggjaren er visingsdelen. Denne er i førstninga delt i tre delar, ovanfrå og nedover:

  1. Sideoverskrift – dra kontrollelementfelt med fast tekst til området for sideoverskrift.

  2. Detalj – dra og slepp databasefelta inn i detaljområdet.

  3. Botntekst – dra og slepp kontrollelementfelt med fast tekst inn i området for botnteksten.

For å setja inn ei rapportoverskrift til og eit rapportbotntekst-område, vel Rediger → Set inn topptekst/botntekst i rapporten. Desse områda inneheld teksten som vert vist i byrjinga og slutten av heile rapporten.

Klikk ikonet «-» framføre eit områdenamn for å komprimera det til éi linje i visinga for rapportbyggjaren. Ikonet «-» vert endra til «+», og du kan klikka dette teiknet for å utvida området igjen.

Du kan setja inn databasefelt med dra og slepp i detalj-området. Sjå bolken «Setja inn felt i rapporten» nedanfor.

I tillegg kan du klikka etikettfeltet eller tekstboksikonet i verktøylinja og så dra eit rektangel i området for topp- eller botnteksten for å lage ein tekst som er den same på alle sidene. Skriv inn teksten i «Etikettboksen» til det tilhøyrande eigenskapsvindauget. Du kan også leggja til grafikk ved å bruka ikonet «Grafikk».

Slik koplar du rapporten til ein databasetabell

  1. Flytt musa til eigenskapsvisinga. Du ser to faner: «Generelt» og «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.

Add fields to report

The Add Field window helps you to insert the table entries in the report.

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

Without sorting or grouping, the records will be inserted into the report in the order in which they are retrieved from the database.

  1. Open the Report Builder view and click the Sorting and Grouping icon on the toolbar. You see the Sorting and Grouping dialog.

Icon Sort and Grouping

Icon Sort and Grouping

  1. In the Groups box, click the field which you want as the first sort field, and set the Sorting property.

  2. Execute the report.

Grouping

  1. Open the Report Builder view and click the Sorting and Grouping icon on the toolbar. You see the Sorting and Grouping dialog.

  2. In the Groups box, open the Group Header list box and select to show a group header.

  3. Click the Add Field icon to open the Add Field window.

Icon Add Field

Icon Add Field

  1. Drag-and-drop the field entry that you want to group into the group header section. Then drag-and-drop the remaining fields into the Detail section.

  2. Execute the report. The report shows the grouped records.

If you like to sort and group, open the Report Builder view, then open the Sorting and Grouping dialog. Select to show a Group Header for the fields that you want to group, and select to hide the Group Header for the fields that you want to be sorted. Close the Sorting and Grouping window and execute the report.

Updating and printing your data

When you insert some new data or edit data in the table, a new report will show the updated data.

Click the Reports icon and double-click your last saved report. A new Writer document will be created which shows the new data.

Icon Reports

Icon Reports

To print a report, choose File - Print from the Writer document.