Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

How-to

How to print a database report or save it as PDF

Reports in Base by Zaweba print or save as PDF in portrait or landscape A4, and the preview, the print-out and the PDF show exactly the same pages.

How to print a database report or save it as PDF

Every report in Base by Zaweba can be printed or saved as a PDF. You build it from a table or query, choose portrait or landscape A4, and print it or save it. The live preview in the report designer, the paper copy and the PDF all draw the same laid-out pages, so what you see is what you get.

Building the report

Pick the table or query the report is based on. A query is often the better base, since it lets you choose and order the columns, join tables (an order with its customer's name, for example) and filter out what isn't wanted.

Then choose a column to group by, if you want groups. A members report grouped by membership type gives a heading for each type with its members underneath. For each number column you can show a sum, a count or an average, as a subtotal under each group and a grand total at the end. Set the sort so the lines inside each group come out in a sensible order.

Portrait or landscape

Portrait A4 suits lists with a few columns: names, phone numbers, a total. Landscape suits wide reports with many columns, and especially crosstab summaries, where months or categories run across the page. If columns look squashed in the preview, try landscape before removing anything.

The designer shows a live preview of the laid-out pages as you work. Use it to check page breaks, group headings and totals before printing. Because the print-out and the PDF are drawn from the same layout, there are no surprises at the printer.

Printing for a chosen period

Reports work well with parameter queries. Base a report on a query with a condition such as [Which month?] and it asks each time it runs, then prints only those records. One report then covers every month, town or category you might need.

A button for regular reports

If a report is printed often, put a button for it on a form or on the main menu. One of the button actions is printing a report, so the club treasurer or the shop assistant can produce it with one click without going near the report designer. Create > Switchboard makes a menu form with a button for every report as well as every form and query.

PDF or something else

A PDF is the right choice for sending a finished document: a price list to customers, a membership list to committee members, a statement to an accountant. It looks the same on any device and can't be edited by accident.

If the person receiving it wants to work with the numbers, export instead. Any table or query exports to CSV, and Database > Export to .xlsx writes an Excel workbook with real dates, money in pounds and filters on the headers. Many people send both: the PDF to read and the spreadsheet to sort.

Reports once the site is online

When you export the database as a PHP and MySQL website, saved reports become read-only pages, so people can check the latest figures in a browser without a copy of the file. Printing and PDFs are a desktop job in Base by Zaweba, and the website shows the data instead.