Working with bands and page breaks

When you are creating a report design, bands are displayed horizontally across the report design page to define logical sections of the report. They are also necessary to control how sections of a report are repeated when you run or print a report. You can add group bands to reports to break information into groups of data; for example, you can group by a range of values. You can also modify bands, specify band printing preferences, and use bands to sort records. In addition, you can add page breaks to reports.

In this section, you'll learn about

  displaying band labels and selecting bands
  
  resizing bands
  
  adding group bands
  
  modifying, deleting, and repositioning group bands
  
  suppressing data when running or printing reports
  
  choosing group band printing preferences
  
  sorting records
  
  modifying band header order
  
  working with page breaks
  
For more information about working with bands and page breaks, see "Reference: Working with bands and page breaks."

Displaying band labels and selecting bands

Each band in a report design is identified by a band label or a boundary line. Displaying the band labels makes it easier to select bands when working with a report design.

To display band labels

  In the report design window, click View  Band labels.
  
If the band labels are displayed, a check mark will display beside it on the menu.

To select a band

  In the report design window, click a band label.
  
Note

  If a band is selected, it is highlighted in the sidebar along the left side of the report design window. The status bar at the bottom of the desktop also indicates which band is selected.
  
Tip

  You can select a band by clicking any white or unused area inside the band.
  
Resizing bands

Bands in a report design can be resized to control the amount of white space that appears in the report. When you design a report, page, report, and record bands automatically display in the report design, and you cannot delete these default bands. However, you can resize them to zero so they will not display in a report.

This image illustrates the four types of bands found in a report design.

To resize a band

1	In the report design window, click a band label.

2	Point to the edge of the band.

The pointer changes to a double-headed arrow.

3	Drag the top edge of the band up to increase the size of the band.

If you want to decrease the size of the band, drag the top edge of the band down.

Note

  You cannot resize a band to be smaller than the objects it contains.
  
Tip

  You can resize a band using the keyboard by pressing TAB to select a band and pressing the up or down Arrow keys to resize the band.
  
Adding group bands

You can place group bands in a report to break information into groups of data. You can base groups on the value of a field, a range of values, or a specified number of records.

Group bands are placed between the page band and the record band in the report design window. You can place two group bands in a report to use a field or range grouping in combination with a grouping by a number of records, but you cannot place a field group band within a range group band.

You can group a report based on the value of a field. For example, you can view your customers grouped by their country or state, or view orders grouped by a method of payment.

You can also group the report by groups of records by specifying the number of records you want to appear in each group. You can also specify a group band based on a range, and you can specify only one range group in a single report. The range can be based on numeric, alpha, or date and timestamp fields, but ranges are not allowed on logical fields.

When you specify a range based on a numeric field, such as a number, currency, short number, dBase number, or float number field, the number you specify for the range determines the intervals for the groups. For example, you need to create a report based on a customer table and you want to group the customers by their customer identification numbers. If you specify the range size 1000 and run the report, the first group of customers begins with customer number 1 and increases by 1000. The second group of customers begins with customer number 1001 to 2000, and so on.

When you specify a range based on an alpha field, you need to specify the number of characters on which to create the group. For example, if the field you're grouping by contains customer last names, a range of 3 ensures that Simmons and Simpson are in the same group and that Sidney is in a different group when you run the report.

When you group by a range on a date or timestamp field, groups are determined by day, week, month, quarter, or year, and are always chronological. For example, when you group by month, April 1998 and April 1999 display as separate groups.

To add a group band defined by a field value

1	In the report design window, click Insert  Group band.

2	Enable the Group by field value option.

3	Choose a table from the Table list.

4	Choose a field from the Field list.

Note

  When you create a group band defined by a group value, a field object representing the field by which you are grouping is automatically placed in the header of the new group band. If you prefer, you can delete this field.
  
To add a group band defined by records

1	In the report design window, click Insert  Group band.

2	Enable the Group by record option.

3	Type a value in the Number of records box.

  Paradox accepts fractions when you define a range in number or money fields. Ranges in short, long integer, and autoincrement fields require whole numbers. You cannot define a range in Binary Coded Decimal (BCD) or time fields.
  
To add a group band defined by a range

1	In the report design window, click Insert  Group band.

2	Enable the Group by field value option.

3	Choose a table from the Table list.

4	Choose a field from the Field list.

5	Enable the Range group check box.

6	Type a value in the Range group box.

If you chose a date field, choose a date option from the Range group list.

Note

  If you do not specify a range, a new group begins every time the field value changes.
  
Modifying, deleting, and repositioning group bands

You can modify and delete group bands. You can also reposition a group band if a report has multiple group bands.

To modify a group band

  In the report design window, right-click the group band, and click Define group.
  
To delete a group band

1	In the report design window, click a group band label.

2	Click Edit  Delete.

Tip

  You can also delete a band by clicking a band label and pressing DELETE.
  
To reposition a group band

  In the report design window, drag the group band above or below another group band.
  
With the band selected, you can also use the Up and Down Arrow keys to move the band.

Suppressing data when running or printing reports

Paradox lets you suppress data when running or printing reports.

When you create a group band based on a field value, the field value is displayed in every record, even if it is the same throughout the group. However, when you suppress repeated field values of a group, only the value of the first record of the group is displayed or printed.

The following example shows a report that has a group defined on the Customer Number field. By suppressing repeated group values, only the first record in each group displays the customer number.

Information located in the page footer area of a report prints at the bottom of every page. Sometimes it may be desirable to print information only on the last page of the report. You can place this information in the report footer; however, it will appear above the page footer.

You can also begin a new page and reset the page to one when a specified band is reached.

To suppress repeated group values

1	In the report design window, click Format  Properties.

2	Click the General tab.

3	Enable the Remove group repeats check box.

To suppress the header and footer on the first page

1	In the report design window, right-click the page header or footer band, and click Properties.

2	Click the General tab.

3	Disable the Print on first page check box.

To print the page footer on the last page of a report

To print the page footer on the last page of a report, you need to complete the following procedures in the sequence in which they are provided. The technique presented here involves placing three fields in the page footer. You need to place a Record Number field, a Number of Records field, and a calculated field.

Before following the procedures, you need to make sure that your report is attached to a table or data model. In addition, you need to have some white space in the page footer to allow for field placement.

To add the record number field to the page footer

1	In the Report design window, click View  Band labels.

If band labels are enabled, a check mark is displayed next to the menu item.

2	Click the page band label to select it.

3	Click Insert  Field.

If an Expert is launched, cancel the Expert.

4	Right-click the field and click Define field.

5	In the Define field object dialog box, click the list box of the table you want to add the Record number field to and click Record number.

6	Click OK.

To add the number of records field to the page footer

1	Click the page band label to select it.

2	Click Insert  Field.

If an Expert is launched, cancel the Expert.

Drag the number of records field to a new location in the page footer.

3	Right-click the field and click Define field.

4	In the Define filed object dialog box, click the list box of the table you want to add the Number of records field to and click Number of records.

5	Click OK.

To match fields to the page background color

When you print your report, specifying that the Record number and the Number of records fields match the page background color, make the values for Record Number and Number Of Records invisible.

1	Hold down SHIFT and select the Record number field and the Number of records field.

2	Right-click the selected fields and click Properties.

3	Click the General tab.

4	Choose Edit from the Display type list box.

5	Click a color on the color palette that matches the color of the page background.

For example, if the background color is white, click white on the color palette.

6	Click Apply.

7	Click inside the record number field to select the label, right-click and click Properties.

8	Click a color on the color palette that matches the color of the page background.

9	Repeat steps 7 and 8 for the number of records field properties.

To create a calculated field

1	Click the page footer to select it.

2	Click Insert  Fields.

If you want to change the position of the new field, drag it to a new location in the page footer.

3	Right-click the field and click Define field.

4	In the Define field object dialog box, enable the Calculated check box.

5	Type the following expression in the Calculated box:

	iif(Record_Number = Number_of_Records, CumSum([orders.Total Invoice]), "")

"Your Value", for example CumSum ([]), is the value that you want to print only on the last page of your report.

Record_Number and Number_Of_Records are special fields that contain data about the table as a whole.

6	Click OK.

To specify a number format for the calculated field

1	Right-click the calculated field, and click Properties.

2	Click the Format page.

3	In the Data type area, enable the Number option.

4	Choose the appropriate format from the Format list.

For example, if you want to display a currency, choose Windows $ from the list.

5	Click Apply.

If you want the calculated field to be unlabeled, right-click the field and click Properties. In the General page, choose Edit from the Display type list box.

To run the report

  Press F8 to run the report.
  
The value in the calculated field that is placed in the page footer should only appear on the last page of the report.

Tips

  You can change the text of the calculated field by selecting the word LABEL inside the calculated field and positioning the cursor inside the text. You can then edit the text object. For example, you may want the label to display the word "Page."
  
  You can resize the fields to fit the size of your data by clicking the field and dragging the selection handles.
  
To start page numbers at one when a band is reached

1	With a report open in the design window, right-click a record band, and click Properties.

2	Click the General page.

3	Enable the Start page numbers check box.

Choosing group band printing preferences

When you print a report that contains a group band, you can print a group heading at the beginning of each group. You can choose to print, or not to print, the heading at the top of the page when the group continues across a page break.

To set printing preferences for group header

1	In the report design window, click a group band.

2	Click Format  Properties.

3	Click the General tab.

4	In the Header area, enable one of the following options:

  On page and group-prints the group heading at the beginning of each group and at the top of a page when the group is continued across page breaks
  
  On group only-prints the group heading at the beginning of each group, but not at the top of a page when the group is continued across page breaks
  
To set printing preferences for objects in group headers

1	In the report design window, right-click an object in a group band, and click Properties.

2	Click the Run time tab.

3	In the Conditional area, enable one of the following check boxes:

  Print at group-displays the object at the beginning of each group but not at the top of each page, unless a group begins at the top of the page
  
  Print at page-displays the object at the top of the page whenever a group breaks across pages. The object never displays on the first page of the report
  
Sorting records

Paradox lets you sort your report data by choosing the fields on which you want to sort and specifying the order in which you want them sorted. The field data is sorted in ascending or descending order. You can also specify the sort order for a group band.

To sort records

1	In the report design window, right-click the record band, and click Sort.

2	Choose a field on which you want to sort from the Fields list.

3	Click the Right arrow button to place the field in the Sort order list.

4	Choose the field from the Sort order list.

5	Click Sort direction to define whether you want to sort in ascending (+) or descending (-) order.

The sort direction option, for example +, displays next to the field in the Sort order list.

Tip

  You can change the sort order of the fields in the sort order list by clicking the Change order Up or Down arrows.
  
To specify the sort order for a group band

1	In the report design window, right-click the group band, and click Properties.

2	Click the General tab.

3	Enable one of the following options:

  Ascending-prints the groups from A to Z or in numeric order.
  
  Descending-prints the groups from Z to A or in reverse numeric order.
  
Modifying band header order

By default, the report header is printed before the page header, but you can modify the header order.

To modify the header order

1	In the report design window, right-click a report band and click Properties.

2	Click the General tab.

3	Disable the Precede page header check box.

Note

  When you enable the Precede page header check box, you will not see the change in the report design window because the bands themselves do not move. The change takes effect when you preview or print a report.
  
Working with page breaks

Paradox lets you insert or move page breaks in reports. For example, you can place a page break in a report header to produce a multi-page report header or to separate the header from the first page of the rest of the report. To insert or delete page breaks in a report, use the sidebar. The sidebar is located between the ruler and the window's frame on the left side of the report design window.

To display the sidebar

  In the report design window, click View  Ruler.
  
To insert a page break in a report

1	In the report design window, click Insert  Page break.

2	Click in the report where you want a page break to display.

A line displays across your record, and a page break marker displays in the sidebar.

Notes

  You can place a page break in any band except the page band.
  
  A page break cannot cross an object in a band. It must fall either above or below any existing objects.
  
Tip

  You can also insert a page break by clicking in the sidebar where you want the page break to appear.
  
To move a page break

1	In the report design window, point to the page marker.

The pointer changes to a double-headed arrow.

2	Drag the page break marker up or down.

To delete a page break

1	In the report design window, click the page break.

If the page break is selected, selection handles will display at both ends of the page break.

2	Click the DELETE key.

Tip

  You can delete a page break by clicking the page break in the sidebar and dragging it out of the sidebar.
  
Reference: Working with bands and page breaks

The following topic contains reference information pertaining to report bands.

Report bands

The report band defines the report header and footer areas. The report header is printed once, at the beginning of the report, and the report footer once, at the end of the report.

A typical report header would contain information such as a company logo or report title. A report footer might contain an "end of file" statement. Summaries and calculated fields that are placed in the report header or footer that summarize data for the entire table are also contained in the report band.

Page bands

The page band defines the header and footer areas of each report page. Unlike other bands, the page bands don't expand vertically when you view or print the report. Therefore, expanded objects, such as tables, are clipped to fit them inside the band.

By default, three objects are placed in the top page band or page header. The Today field displays at the left margin of the page header and displays the print date of the report. The second object is a field that contains the default title for the report. In a single-table report, the name of the table is used as the default title. In a multi-table report, the name of the master table is used as the default title. The third object is the Page field that displays at the right margin of the page header.

Record bands

The record band contains the body of the report. You can place data elements such as fields, charts, crosstabs, multi-record objects, and table frames in the record band. These elements contain the data from the table. Depending on the type of report you want to create, certain objects are automatically placed in the record band.

Report type	Objects placed

Tabular	The records of the table to which the report is bound displays within a table frame in the record band.

Single-record	Field objects are placed in the record band.

Multi-record	Field objects are placed within a multi-record object in the record band.

Blank	No objects are placed in the record band.

The record band repeats once for every record in the master table, unless the record band contains a table, multi-record object, crosstab, or tabular chart on the master table. In that case, the contents of the record band displays once for every set of records in the master table.

For example, if you place a crosstab on the master table in the record band, it will be printed once for each record in the table. Usually, you should put a crosstab on the master table in either the header or footer of the report band. With a one-to-many relationship in your data model, it is often appropriate to put a crosstab in the record band of the detail table to generate a crosstab for each master's detail set. For more information about crosstabs, see "Using crosstabs."




