Planning your report

Before you actually create your report, you should take a few moments to plan what you’re going to do. You need to decide what information you want to include, and what—roughly—you want it to look like. (See Defining a simple report for the steps you need to follow to actually create the report.)

What information do you want to include?

Think about what data you want to appear in your report. For example, if the purpose of your report is to itemize and then total the amount of money your customers owe you, you will want to include, at a minimum, some way to identify the customer (such as the customer name or number) and the customer’s outstanding balance. Perhaps you also want to include the customer’s telephone number and the name of your contact, so you can call and remind them to pay you if payment is overdue.

When you define a new report, you first need to select the files that you want ReportWriter to read. This means you need to know (or figure out) which files contain the information you want to include.

In our example, let’s say the customer name, outstanding balance, and telephone number are all stored in the customer file. The customer contact name is stored in the contact file. Therefore, in the Files to read function of ReportWriter, you would need to select both the customer file and the contact file.

The order in which you select files is important because that’s the order in which ReportWriter reads them.

In our case, the link between the customer file and the contact file is the customer number. If you select the contact file first, and the contact file contains more than one contact for each customer, your report will contain the same customer more than once. However, if you select the customer file first, ReportWriter will read each customer number and then look for the associated entry in the contact file. In our example, therefore, you would select the customer file first. (If you were defining a report that listed all of your contacts at customer sites, you would want to select the contact file first.)

OK, so now you’ve decided which files you want ReportWriter to read:

and what information you want to include:

How do we know if the balance is past due? We could include the due date as a field in our report and then compare it to today’s date, but why not let ReportWriter do that work for us? We can create a temporary calculation field that subtracts the due date from today’s date and gives us the number of days (if any) that the bill is past due. We could also create a temporary text field to flag with an asterisk customers whose payments are more than 30 days past due.

ReportWriter makes the temporary field information available in a temporary file, so once you create a temporary field, you can select it for inclusion in your report just like any other field.

Do you want to include all of your data records in your report, or just a subsection? For example, in our sample report, should we include all customers, or just customers who have an outstanding balance? Since the purpose of this report is to track the amount of money your customers owe you, there’s no point in including customers who don’t owe any money.

When you define your report, you can use selection criteria to weed out the records you don’t want. To include only customers who don’t have a zero balance, you’d set up a selection criterion for an outstanding balance greater than 0.

How do you want your report to look?

You also need to decide what you want your report to look like.

Fields are displayed in the order you select them when you define your report. For example, if you want the customer name to appear in the first column, select the CUSTOMER_NAME field first. You can always change the field order later, but it helps to have a mental picture of your intended report layout before you begin.

If you want the numbers in any column of your report to be totaled, you need to tell ReportWriter to total that field. In our example, you’ll want to total the outstanding balance field. ReportWriter will then print a total at the bottom of the outstanding balance column.