Creating Reports

From Apache OpenOffice Wiki
Jump to: navigation, search




Creating Reports

Reports provide information found in the database in a useful way. In this, they are similar to queries. Reports are generated from the database's tables or queries. They can contain all the fields of the table or query, or just a selected group of fields. Reports can be static or dynamic. Static reports contain the data in the selected fields at the time the report was created. Dynamic reports can be updated to show the latest data.

For example, a report on expenses in the past should probably be a static report because it is based upon specific data that does not change. However, a report on year-to-date expenses should probably be a dynamic report because this report depends upon data that does change.

All reports are based upon a single table or query, and you need first to decide what fields you want to use in the report. If you intend to use fields from different tables, you must first combine these fields in a single query. Then you can create a report on this query.

The most flexible method for making a report is to write a query that returns the desired columns and sorts the rows, and then save this query as a View in the database. A View is simply a query whose code has been stored alongside the database tables, and it can be treated just like a table. To make a View from a query, click on the Queries icon in the main Base window, then right-click on the name of the specific query and select Create as View. You will be prompted for a name to give the View. A good practice is to give the View the same name as the query, with View as either a prefix or suffix. For the View made from the GrpCalcColumn query that we will use in the reports, we used the name GrpCalcColumn_View. This makes it easy to see the code saved in the View. Keep in mind that editing the query after saving the View does not change the View. You would have to make a new View to embody the new query. Once the View is saved, it will be listed along with the tables in the database.

Once a View is ready for the report, making the report is very simple.

Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools