Reports


Chapter 3. Introducing Report Structure

The Panther editor offers two views into a report file: the physical layouts used by a report are shown in the layout window, while specifications for report generation are schematically rendered in the Report Structure window. This chapter focuses on report structure components and their properties.

The report structure for any report is available by choosing ViewReport Structure.


Report Structure Window

The Report Structure window schematically shows how a report executes. Stages of report execution are depicted in a vertical hierarchy composed of nodes. The topmost node defines a report; when this report runs, all nodes below and subordinate to it execute in top-down order.

For example, the following column report sorts orders from video store outlets by distributor name and order number:

Figure 3-1 Column report by distributor name and order number

Figure 3-2 shows how execution of this report is viewed through the Report Structure window and its corresponding layout window. The two windows offer complementary views into the same report definition:

Figure 3-2 Structure of report that outputs video outlet orders.

Figure 3-2 shows a report structure composed of these node types:

Node Classes and Types

Nodes belong to one of two classes—structure nodes and action nodes:

Table 3-1 lists the different node types and summarizes their purpose:

Table 3-1 Report structure node types

Type Purpose More Information...

Structure nodes:

Report

Defines a report.

"Defining a Report"

Page Format

Specifies page format and orientation.

"Setting Page Format"

Instance

Provides an all-purpose hook for one-time execution of the attached action nodes.

"Processing One-Time Events"

Detail

Specifies the source of report data and actions to perform at each fetch.

"Fetching Report Data"

Group

Specifies how to group data and the processing to perform when a new group is generated.

"Creating Groups"

Action nodes:

Print

Outputs a layout area.

"Outputting Detail Data"

Call

Calls a function.

"Calling Functions"

Subreport

Invokes a subreport.

"Invoking Subreports"

End Page

Forces a page break and starts a new page.

"Forcing Page Breaks"

You can attach any number and type of action nodes to all structure nodes except a report node. Action nodes can be attached in any order.

Node Hierarchy

The order of a report's structure nodes is summarized in this formula:

A report structure conforms to these rules:

The flexibility offered by report structures lets you create almost any flavor of report with as many levels of complexity as needed.

Editing the Report Structure

You can modify the report structure by adding, removing, and moving nodes. You can also control the amount of detail shown by collapsing and expanding portions of the structure's hierarchy.

How to Add a Node

  1. Select the node type from either of the following:
  2. Select the node that is above the position desired for the new node.

How to Delete or Remove a Node

Select a node and do one of the following:

How to Copy a Node

Select the node to copy and choose EditCopy or the Copy button from the toolbar.

This places a copy of the node and its attachments in the structure's clipboard. You can then paste the copy anywhere its placement is valid in the report structure. The copy remains in the clipboard until it is overwritten by the next Cut or Copy operation.

How to Paste a Node

  1. Choose EditPaste or the Paste button from the toolbar.
  2. Select the node that is above the position desired for the pasted node.

How to Move a Node

Select the node that you want to move. Do either of the following:

How to Collapse and Expand the Structure View

Click on a node's type ID button to toggle all attached nodes in and out of view; or from the Edit menu, choose ArrangeExpand or ArrangeContract. Figure 3-3 shows how you can collapse and expand portions of the report structure.

Figure 3-3 Click on a node's type ID button to collapse and expand the view of its subordinate nodes.

You can also collapse or expand the entire structure. From the Edit menu, bring up the Arrange submenu and choose the desired option:

Editing Node Properties

Through the Properties window, you can edit the properties of any selected node. To bring the Properties window into focus for the current node, give focus to the node. An arrow marks the selection; you can bring the Properties window forward by double-clicking on this arrow.

Each node type has one or more properties that are unique to it; these are discussed in later sections. Nodes also share a common set of Identity properties; these are discussed below.

Name
A node's Name property identifies it for programmatic access. Named nodes can be accessed at runtime in order to change their properties. For example, naming a print node lets you access its area property and set it according to the runtime context:
if amount < 0
{
detail_output->area = "debit_entry"
}
else
{
detail_output->area = "credit_entry"
}

Report nodes must be named in order to be explicitly invoked—for example, by another report or from the command line.

Refer to "Naming Conventions" in Using the Editors for more information about widget naming conventions and requirements.

Inherit From
Defines the source of inheritance for this report—the name of the repository report followed by the name of the parent object in this format:
repository-entry!widget-name

A node can inherit any properties that are set in its source, such as Break On and Orientation. However, nodes cannot inherit their relationships to each other as specified by their relative order in the repository entry's report structure.

For more information about inheritance, refer to "Controlling Inheritance" in Using the Editors.

Comments
By including a brief description of a node, you can save information about this node and its purpose:
  1. Select the node.
  2. Under Identity, select the Comments property. The Comments dialog box opens.
  3. Enter or edit text through one of these actions:
  4. Choose OK to save the comments and return to the Properties window.

Viewing Node Links

You can review dependencies between a node and widgets in the layout window by selecting that node and choosing ReportShow Property Links. The Property Links dialog displays, which contains two types of entries:

For example, this dialog shows the links for a group node:

Figure 3-4 Property Links dialog shows the widgets that are specified in a node's properties.

Note: The Property Links dialog only shows links to existing widgets; if a property specifies a widget or node that does not exist—either because it is not yet created or it is included at runtime—the dialog omits this link.

Going to a Property Link

When you display the Property Links dialog, you can give focus to the widget or node specified in the selected entry by choosing Go To, or by double-clicking on the entry. If the widget is in the layout window, this window gets focus.