Operation Manual

Creating reports
Reports provide information found in the database arranged in a useful way. In this respect, they
are similar to queries. Reports are generated from the database’s tables, views, or queries.
All reports are based upon a single table, view, or query, so you need first to decide what fields you
want to use in the report. If you want to use fields from different tables, you must first combine
these fields in a single query or view. Then you can create a report from this.
For example, a report on vacation expenses includes both fuel costs and meal costs. These values
are contained in fields of two different tables: Vacations and Fuel. So this report requires you to
create a query or view.
Caution
Dynamic reports update only the data that is changed or added to a table or query.
They do not show any modifications made to the table or query itself. For example,
after creating the report below, open the fuel economy query created in the previous
section. For the "End-Reading".”Odometer” – “Fuel.”Odometer” column, change the
number 1 to the number 3. The report will be identical before and after you make the
change. But if you add more data to the query and run the report again, it will contain
the new data.
Creating a report
We will create a report on vacation expenses. Certain questions need to be asked before creating
the report.
What information do we want in the report?
How do we want the information arranged?
What fields are required to provide this information?
Will a query or view have to be created because these fields are in different tables?
Are there any calculations required in the data before being added to the report?
The expenses for our vacation are motel, tolls, miscellaneous, breakfast, lunch, supper, snacks,
and fuel. One possible report could list the totals of each of these expense groups. Another could
list the expense totals for each day of the vacation. A third could list the totals for each expense
group for each type of payment. (This would let us know where the money came from to pay the
expenses.) Once you create a query to do any one of these, you can create a report based upon
the query.
We will create two reports, one listing the expenses each day (other than fuel) and the second
listing fuel statistics. The fields we need for the first report from the Vacations table are: Date,
Motel, Toll, Breakfast, Lunch, Supper, SnackCost, and Miscellaneous. This report only requires the
Vacation table. Had the report listed the total expenses for each of these fields, we would have to
create a query to provide us with these totals.
The second report involves the Fuel table. Since this table includes fuel purchases at times other
than during the vacation, we need to create a query that contains only the fuel purchased during
the vacation.
Static vs dynamic reports
When creating a report using the Report Wizard, you have a choice of two types of reports in the
last page of the wizard: static or dynamic. What you should select depends more upon whether
you have a working Report Builder extension or not. If this extension works in your version of
LibreOffice, you should select dynamic every time. Otherwise, your selection should depend upon
254 | Getting Started with LibreOffice 4.0