Copyright: ®2000-2003 SoftVelocity Inc.


Clarion ReportWriter
Clarion ReportWriter for Windows

The Report Formatter

Common Questions

Using the Runtime Print Engine


Main application window
Report Writer

Button/Menu Command	What it Does

 (File [image] New)	Creates a New Report Library

 (File [image] Open)	Opens a Report Library

 (File [image] Pick)	Displays a list of recently used Report Libraries.


Report Library dialog

This window lists the reports in your Report Library.

Button	What it Does

New	Creates a new Report in the Library.

Edit	Modifies the highlighted Report in the Library.

Preview	Runs the highlighted Report in Preview Mode.

Print	Prints the highlighted Report.

Properties	Modifies the Properties of the Report Library.

Moves the highlighted Report up in the Library.

Moves the highlighted Report down in the Library.

Delete	Deletes the highlighted Report.

Close	Closes the Library.


Report Formatter
Toolbar    Control Toolbox    Alignment Tools  Property List     Field Selection List     Non-Printing Guides

This topic covers the tools available in the Report Formatter.

For Information on how to accomplish specific tasks, See Common Questions .

ToolBar

Control	What it Does

The Page spin control allows you to jump to any page of a multi-page report.

The Band drop-down list allows you to jump to any band of a multi-band report.

The Scale drop-down list allows you to resize the formatter's view on your display.

Calls the File Schematic.

Calls the Sort Order window.

Toggles display of the Control Toolbox.

Toggles display of the Alignment Toolbox.

Toggles display of the Property List.

Toggles display of the Field Selection List.

Runs the report and displays it in Preview Mode.

 ControlToolBox

Button	What it Does

The Cancel Selection Tool returns your cursor to its default state, and cancels a selection. If you click on a Toolbox button and don't want to place a control, clicking on this tool deactivates the selection.

The String Control Tool places a control containing a single line of constant text. This is equivalent to choosing Control [image] String Control from the menu.

The Field Tool places a data field from a file, or a report specific field on a report. This is equivalent to choosing Control [image] Data Field from the menu.

The Field Total Wizard Tool quickly creates and places a total field on a report This is equivalent to choosing Control [image] Field Total from the menu.

The Text Tool places a multi-line text control from a file, or constant text, on a report. This is equivalent to choosing Control [image] Text Control from the menu.

The Check Box Tool places a check box on a report, most commonly used to represent a logical field--one that contains a true or false value. If true, the check box prints with an X marking it; if false, the check box prints as a box. This is equivalent to choosing Control [image] Check Box Field from the menu.

The Horizontal Line Control Tool places a Horizontal Line graphic control on a report. This is equivalent to choosing Control [image] Graphic Control [image] Horizontal Line from the menu.

The Vertical Line Control Tool places a Vertical Line graphic control on a report. This is equivalent to choosing Control [image] Graphic Control [image] Vertical Line from the menu.

The Rectangle Control Tool places a rectangular shaped graphic control on a report. This is equivalent to choosing Control [image] Graphic Control [image] Rectangle from the menu.

The Ellipse Tool places an elliptically shaped graphic control on a report. This is equivalent to choosing Control [image] Graphic Control [image] Ellipse from the menu.

The Group Box Control tool places a grouping box around controls on a report. This is equivalent to choosing Control [image] Group Box from the menu.

The Image Control Tool places an image graphic control on a report. This is equivalent to choosing Control [image] Graphic Control [image] Image from the menu. This control can display a graphic image from any of the supported graphic file types (.BMP, .JPG, .ICO, .CUR, .WMF, or .GIF).

Alignment ToolBox

Control	What it Does

Align Left	Aligns the left borders of the selected controls with the left border of the last control selected (red handles).

Align Right	Aligns the right borders of the selected controls with the right border of the last control selected (red handles).

Align Top	Aligns the top borders of the selected controls with the top border of the last control selected (red handles).

Align Bottom	Aligns the bottom borders of the selected controls with the bottom border of the last control selected (red handles).

Align Horizontally	Along a horizontal axis, aligns the centers of the selected controls with the center of the last control selected (red handles).

Align Vertically	Along a vertical axis, aligns the centers of the selected controls with the center of the last control selected (red handles).

Spread Horizontally
Equalizes the horizontal space between the selected controls.

Spread Vertically	Equalizes the vertical space between the selected controls.

Make Same Size	Makes all selected controls the same height and width as the last control selected (red handles).

Make Same Height
Makes all selected controls the same height as the last control selected (red handles).

Center Horizontally
Centers the selected controls horizontally in the band.

Center Vertically	Centers the selected controls vertically in the band.

Property List

Bands and Control behavior is defined through their properties. Each Band type and Control type has its own set of properties. By specifying properties you can, for example, print a report's title in a specified font or ensure that a group header band prints on the same page as its group details.

Properties are specified through the Property List. This list changes depending on the selected item (control or band). Control and Band Properties are explained in detail later in this chapter.

There are two ways to access the Property List. You can enable the "floating" Property list by pressing the  button on the toolbar or you can access the Property List for a single element by right-clicking on it and selecting Properties. When using the floating Property List, you do not need to close the list after each modification. It remains available to modify the currently selected element of your report.

To set an item's properties:

1.	Select the item by CLICKING on it or selecting it from the Property List's drop-down list.

2.	Modify the properties as needed.

Field Selection List

The Field Selection List allow you to populate Data Field controls quickly. This Tool provides access to all the files in the Report's File Schematic.

To populate a control using the Field Selection List:

1.	Select the file from the drop-down list.

2.	DOUBLE-CLICK on the desired field.

3.	CLICK on the report at the location where you want to place the field.

Non-Printing Guides Rulers, Grid, and Guides

Non-printing guides help you position items on a report, but do not print on the report. These lines form the framework of the layout grid. There are three kinds of non-printing guides: Rulers, the layout grid, and Horizontal and Vertical Guides.

Rulers

There are ruled lines at the top and bottom of the formatter. The rulers measure in inches or centimeters, depending on the unit of measurement on which the report is based. Rulers can be useful in lining up items on a report so columns can be kept straight. As you move the mouse, tick marks appear on the rulers which allow you to see the exact position.

Horizontal and Vertical Guides

In addition to the rulers, you can use guides to assist in aligning items on a report. These guides are created by clicking on a ruler. If you click on the horizontal ruler at the top of the formatter, you'll get a Vertical guide at that position. If you click on the vertical on the left side of the formatter, you'll get a Horizontal guide at that position. After a guide is created, you can drag it to any desired location. To remove a guide, merely drag it to the ruler and discard it.

Grid

When you position controls in the report, you can then optionally force them to align on grid points using the Report Grid.

To toggle the Grid on or off:

1.	Choose View [image] Grid.


New Report Library

Control	What it Does

Filename	The DOS filename for the Report Library file. ReportWriter automatically adds the .TXR extension for the file.

Working Directory
The path of the working directory where the library file will be created. Typ in the path or press the ellipsis (...) button to select it from a standard file dialog.

Description	Although optional, the description can help you identify the Report Library.

Password	Type a password in the Password field if you want password protection for your library. Password protection is optional and prevents unauthorized access to this set of reports. No one can modify this set of reports without the password.

Using a password encrypts the Report Library File (.TXR) , preventing anyone from viewing it in a text editor. If you want encryption without a password, use a single asterisk (*) as the password. This prevents casual viewing in a text editor without requiring a password.

Create Using	Select the source from which to create the Report Library in the Create Using section. The choices are:

Dictionary	A Clarion Data Dictionary (.DCT or .TXD).

Report	Another Report Library (.TXR)

Database	An existing database file.

Filename	The file from which to create the Report Library. Type it in or use the ellipsis (...) button to select it from a standard File Open dialog.

Create	Creates the Report Library based on the information you supplied.

Cancel	Cancels the operation.


Pick Report Library

This window lists the Report Libraries recently used.

Button	What it Does

Select	Opens the highlighted Report Library.

New	Creates a new Report Library.

Open	Call a standard file open dialog to opens a Report Library that is not listed.

Moves the highlighted Report Library up in the list.

Moves the highlighted Report Library down in the list.

Delete	Removes the highlighted Report Library from the Pick List. This does not remove it from disk.

Cancel	Closes the Pick List.


New Report Wizard

Control	What it Does

Report Label	Specifies the unique identifier ReportWriter uses for each report. The Label can contain only alphanumeric characters (letters or numbers) or the underscore ( _ ) character, and must begin with a letter. Spaces are not allowed. The maximum length is 40 characters. Each field name must be unique. There can be no duplicate names within a report.

Description	Although optional, the description can help you identify the Report in the  Library. This description displays in the Report Library list.

Report Style	Specifies the unique identifier ReportWriter uses.

Creates a columnar report

Creates a form-based report.

Creates a multi-up column report, most commonly used to print labels.

Creates a freeform report that you can modify in any manner. This wizard populates no fields, providing you with a "blank slate" to create reports.

Report Files	Specifies the File Schematic for the report. See also: Specifying the File Schematic for a Report or Creating a User Defined Relationship.

Add File	Adds a file to the File Schematic.

Remove File	Removes a file from the File Schematic.

Clear	Removes all files from the File Schematic.

Import	Allows you to import a data dictionary.

Next >	Continues to the next wizard dialog.

Cancel	Cancels the Wizard operation.


Wizard fonts dialog

Control	What it Does

Font	Opens a standard Windows Font dialog to select a font for the highlighted band.

Background	Opens a standard Windows Color dialog to select a background color for the highlighted band.

Save as Wizard Defaults
Check this box to save the settings as the defaults the wizards use when creating reports.

Sample	Displays the Font for the highlighted band.


File Schematic

Each report is based on a collection of data files. The report's file schematic is created when you specify files in the Report Wizard. You can modify the File Schematic after the report is created by pressing the [image] button on the toolbar or choosing Report [image] File Schematic.

The File Schematic specifies the files used for the report. Reports use one Primary file and multiple levels of related files.

The File Schematic also lists the available report-specific fields. Report-specific fields are the computed, conditional, total, or runtime fields that have been defined for a report. Report-specific means they are only available for the report in which they are defined.

Before specifying a file schematic, decide which file will be the primary file and which related files you will need for the report.

The File Schematic contains a list box that displays all the files used in a report. The list box displays in a tree format with two sections: Files and Other Data.

Adding Files to the File Schematic

With the Files  section (in the Files list box) highlighted, press the Add File button.

See Also:

Specifying the File Schematic for a Report

Creating a User Defined Relationship

Adding Other Data

1.	Highlight the type of field to add (Computed, Conditional, Runtime, or Total), then press the Add ... Field button.

See Also:

Report-Specific Fields

Editing Field Properties

The Edit button allows you to edit the manner in which Files and Fields display in ReportWriter (depending on the Display Options you have chosen). You can also modify a field's default print format (picture). Highlight the field to edit, then press the Edit button.

You must be in Developer Mode to edit File or Field Properties. For more information see Edit Field Properties and Library Properties.


Insert data field

The File Schematic lists the files used for the report. Reports use one Primary file and multiple levels of related files. The File Schematic also lists the available report-specific fields. Report-specific fields are the computed, conditional, total, or runtime fields that have been defined for a report. Report-specific means they are only available for the report in which they are defined.

To select a field from a file:

Highlight the File in the list on the left, highlight the field in the list on the right, then press the Select button.

To select a report-specific field:

Highlight the field type in the list on the left, highlight the field in the list on the right, then press the Select button.

See Also:

Specifying the File Schematic for a Report

Creating a User Defined Relationship

Report-Specific Fields


Formula Editor (Record Filter)

The Formula Editor helps you to quickly generate a syntactically correct expression. You can use the Formula Editor to create computed fields or conditional fields.

•	A computed field receives the value of an expression. In other words, a computed field is the receiving end of a simple assignment statement: variable = expression. For example, a computed field called GrossPrice might receive the result of adding two fields called BasePrice and Tax.

You can use a computed field wherever the report needs the result of a calculation.

•	A conditional field is a computed field with multiple possible assignments. The assignment statement executed depends on the evaluation of the IF condition. For example, a conditional field called "Tax" could equal 0 when "Taxable" (the IF condition) is false, or "Tax" could equal Price times TaxRate when "Taxable" is true.

You can use a conditional field wherever the report needs different calculations based on a condition.

The Formula Editor dialog gives you access to data dictionary fields, as well as runtime fields and report specific fields, and facilitates creating syntactically correct expressions. This is its prime advantage: automatic syntax checking.

To create an expression, you press buttons to add expression components to the Statement line. You can also type in your expression and check the syntax after.

From any area where a Formula is used:

1.	Press the Formula button.

2.	In the Statement field, create your formula.

You can type in the expression, use the Formula Editor's buttons, or both. The first component of an expression must be an operand, a left parenthesis, or a unary minus (the negative sign). For example, press the Data button and choose a variable, press the Multiply by (*) button, then press the Functions button to choose a Clarion built-in function.

3.	Press the Check button to check the syntax of the expression.

If the syntax is correct, a large green check mark appears to the left of the statement. If the syntax is incorrect, a large red X appears.

4.	Press the OK button.


Select File Driver

ReportWriter uses the selected file driver to import your data file. Select the file driver to use, then press the OK button.


Picture Editor

Some controls let you specify a   picture token that provides a special format for printing variables

There is a great variety and diversity of picture token syntax that depends on the type of data you format: strings, numbers, currency, scientific, dates, times, etc.

The Edit Picture dialog lets you quickly and easily build an appropriate picture token without memorizing picture token syntax. Invoke this easy to use dialog by pressing the ellipsis (...) button beside the Picture prompt in the properties dialog.

Example	An example of the display format currently specified in the dialog. What you see is what you get.

Picture	The picture token currently specified. This picture token produces the example shown.

Picture Type	Select the type of data to format from this drop-down list. Choose from:
String
Numeric and Currency
Scientific Notation
Date
Time
Pattern
Key-in Template

String

String Pictures specify a length with no other formatting.

Length	Specify the length of the string. This length also determines the width of the control if the width is not otherwise specified by the control's AT attribute.

Numeric and Currency

 Numeric and Currency picture tokens specify a length, plus conventional formatting to convey positive and negative values, various currencies, etc.

Size	The total number of significant digits, plus any formatting characters. For example, $22.25- is 4 significant digits + 3 formatting characters for a size of 7.

Decimal Digits	The number of digits to the right of the decimal.

Currency	Choose from None, Leading, and Trailing. None shows no currency symbol. Leading puts the currency symbol to the left of the number and Trailing puts the symbol right of the number.

Symbol	The currency symbol to display: either a dollar sign ($) or a string constant.

Negative Sign	Specify how negative values are formatted.

Bracket	Negatives surrounded by parentheses. (100.00)

Leading	Negatives get a leading minus sign. -100.00

Trailing	Negatives get a trailing minus sign. 100.00-

None	No sign display. 100

Decimal Separator	Specify the character inserted between the integer and fractional portion of the value.

Period	Period is the separator. 100.00

Comma	Comma is the separator. 100,00

None	Displays no separator. 100 00

Grouping	Specify the character inserted at every third digit to aid readability.

Comma	Comma is the separator. 1,000

Period	Period is the separator. 1.000

Space	Space is the separator. 1 000

Hyphen	Hyphen is the separator. 1-000

Leading Character	Specify the character to represent leading zeroes.

Clip	Remove leading zeroes so that any leading format characters abut the left most digit.

Zero	Leading zeroes display as zeroes (0).

Space	Leading zeroes display as spaces ( ).

Asterisk	Leading zeroes display as asterisks (*).

Blank When Zero	Check this box to display nothing when the value is zero.

Scientific

Scientific Notation picture tokens let you display very large or very small numbers with a decimal format raised by a power of ten. The display takes the form -9.99e+999.

Number of Characters	The total number of characters, including the 7 format characters. For example, -1.96e+007 requires 10 characters.

Leading Digits	The number of digits to the left of the decimal point (typically 1).

Decimal Separator	Specify the character inserted at every third digit to aid readability.

Point	Period is the separator.

Comma	Comma is the separator.

Space	Space is the separator.

Separator	Specify the character inserted between the integer and fractional portion of the value.

Point	Period is the separator.

Comma	Comma is the separator.

Blank When Zero	Check this box to display nothing when the value is zero.

Date

Date picture tokens let you display dates in a number of different formats. Choose the format you want from the Format drop-down list.

Format	Choose the format you want from the drop-down list. What you see is what you get except for the Windows Short and Windows Long formats. Additionally, the separator character and leading zeroes may be specified independent of the chosen format.

Windows Short
Uses the short date format specified in the Windows control panel or the Windows 95 Regional Settings control panel.

Windows Long
Uses the long date format specified in the Windows control panel or the Windows 95 Regional Settings control panel.

Separator	Choose from Standard (/), Period (.), Dash (-), Space ( ), and Comma (,).

Leading Characters	Specify the character to represent leading zeroes.

Zero	Leading zeroes display as zeroes (0).

Blank	Remove leading zeroes.

Asterisk	Leading zeroes display as asterisks (*).

Two digit date range	Change the default century interpretation for dates input with a two digit year. By default, Clarion assumes any date input with a two digit year (i.e. the century value is omitted) falls between today-80 years and today+19 years.

For example, if today is June 1, 1996 and the date input is 9/2/59, Clarion assumes the 59 means 1959 since 1959 falls between today-80 years (June 1, 1916) and today+19 years (June 1, 2015). To force a different interpretation, set the Two digit date range to 30. Now Clarion assumes the 59 means 2059 since 2059 falls between today-30 years (June 1, 1966) and today+69 years (June 1, 2065).

Blank When Zero	Check this box to display nothing when the value is zero.

Time

Time picture tokens let you display times in a number of formats. Choose the format you want from the Format drop-down list.

Format	Choose the format you want from the drop-down list. What you see is what you get except for the Windows Short and Windows Long formats. Additionally, the separator character and leading zeroes may be specified independent of the chosen format.

Windows Short	Uses the time format specified in the Windows control panel.

Windows Long	Uses the time format specified in the Windows control panel.

Separator	Choose from Standard (:), Period (.), Dash (-), Space ( ), and Comma (,).

Leading Character	Specify the character to represent leading zeroes.

Zero	Leading zeroes display as zeroes (0).

Blank	Remove leading zeroes.

Blank When Zero	Check this box to display nothing when the value is zero.

Pattern

Pattern pictures let you build custom display formats for various numbers: phone numbers, social security numbers, room numbers, dates, times, measurements, etc.

Picture	Type the picture token between the 'P's according to the Legend below. Your picture token can include any displayable characters, including all the standard keyboard characters.

At runtime, the constants in the picture token display just as they appear in the token. The left angle (<) and the pound sign (#) resolve into the individual digits from the display variable.

Legend	< integer, blank if zero
# integer
constant (any displayable char except < and #)

Blank When Zero	Check this box to display nothing when the value is zero.

To use a lowercase p in your picture, use an uppercase P at the start and end of your picture token. To use an uppercase P in your picture, use a lowercase p at the start and end of your picture token.

Key-in Template

 Key-in Pictures let you build custom edit formats for runtime fields containing mixed alphanumeric characters. Although Key-in tokens affect output as well as input, their primary purpose is to provide custom field editing and validation on input.

Picture	Type the picture token between the 'K's according to the Legend below. Your picture token can include any characters (displayable or not), including all the standard keyboard characters.

Legend	< accept an integer, blank if zero
# accept an integer
? accept any character (even non-display)
^ accept an upper case character
_ accept a lower case character
|  input may stop here
constant (any displayable char except <#?^_| or \)
\ display next char (lets you display <#?^_| or \)

Only alphabetic characters
Check this box to accept only alphabetic characters.

Blank When Zero	Check this box to display nothing when the value is zero.

To use a lowercase k in your picture, use an uppercase K at the start and end of your picture token. To use an uppercase K in your picture, use a lowercase k at the start and end of your picture token.


Select Database File

This window allows you to select a file to add to the Report's File Schematic.

If the file you want to add appears in the list, highlight the file, then press the Select button.

If you want to import another file, press the Other File button.


Select Field

This dialog allows you to select a field to use in a user-defined sort order.

Use the drop-down list to select the file, highlight the field, and then press the Select button.


Page Layout Dialog

Control	What it Does

Paper Size	This field allows you to specify one of a number of common paper sizes. In most cases, you will use the Current Printer Setting.

height x width	This field allows you to specify the dimensions of a paper size not listed.

Orientation	This field allows you to specify one the paper's orientation--Portrait or Landscape.

Line Spacing	This field allows you to specify whether the report is line-based or free form. Choose from:

Free Format	Free format spacing.

Single	Single Line spacing

1.5 Lines	Line and a half Spacing

Double	Double Line spacing

Custom	Custom Spacing. Specify the size in the control to the right.

This determines how the controls are populated.

Page Margins	This field allows you to specify the margins of the printed page.


Sort Order dialog

Control	What it Does

Order By	Select an option from the drop down list. The choices are the keys defined in the Data Dictionary, Record Order, and one for USER DEFINED ORDER. If no defined key fits the sort order, the USER DEFINED ORDER allows you to create a sort order used only by this report (see Creating a User Defined Order).

Sort Fields	Lists the fields by which you report is sorted.

Ascending	Specifies the sort order is from lowest to highest.

Descending	Specifies the sort order is from highest to lowest.

Case Sensitive	Specifies that case is considered when sorting.

When a field contains numeric data, you always want to consider it in a Case Sensitive manner. When case is ignored, numbers are sorted alphabetically.

Group Break	Checking this box adds a Group Break fro the highlighted field. To remove a Group Break, highlight the field and uncheck the box.

Exclude Nulls	Specifies that only records which are not zero or blank are considered.

Add	Adds a field to the list (only available in a user-defined sort).

Delete	Removes a field from the list (only available in a user-defined sort).

Moves a field up in the list (only available in a user-defined sort).

Moves a field down in the list (only available in a user-defined sort).

Ranges	Allows you to set range limits for the report.

Ok	Accepts your entries and continues.

Cancel	Cancels the operation.


Range Limits Dialog

Control	What it Does

Ok	Accepts your entries and continues.

Cancel	Cancels the operation.

Edit	Allows you to edits the range limit for the highlighted field.

New Range	Adds another the range limit for the report. After adding it, you can edit it as needed.

Delete	Removes the highlighted range limit.


User Relations Dialog

This window displays your user-defined relationship. The list on the left displays the fields which link the files together. For more information see: Creating a User Defined Relationship .

Control	What it Does

Add	Adds a user-defined relation.

Delete	Removes a user-defined relation.

Edit	Allows you to modify a user-defined relation.

Relationship	Allows you to specify the type of relationship.

Ok	Accepts your entries and continues.

Cancel	Cancels the operation.


Link Fields Dialog

This window displays the link fields for your user-defined relationship. The two drop-down lists contain all the fields in the two files. For more information see: Creating a User Defined Relationship .

Control	What it Does

Link From	The linking field from which the link is created.

Link To	The linking field to which the link is created.

Case Sensitive	Check this box if you want to consider case when joining the files. To ignore case, uncheck the box.

Ok	Accepts your entries and continues.

Cancel	Cancels the operation.


New Text Control Dialog
Text Control Dialog

Control	What it Does

Field	If the Text control's source is a field, type the field label or use the ellipsis (...) button to select it from a list.

Text	This field allows you to type in multiple lines of static text.

Auto-Resize	Check this box if you want the control to expand and contract based on the field's contents.


Auto Populate Dialog

Control	What it Does

Available Fields	This list displays the fields available for your report. Select the file you want in the drop-down list. The file's available fields appear in the list box.

Selected Fields	This list displays the fields you have selected to populate on the report.

Adds the highlighted field to the Selected Fields list.

Adds all Available Fields to Selected Fields list.

Removes the highlighted field from the Selected Fields list.

Removes all Selected Fields from the current file from the list.

Moves the highlighted field up in the Selected Fields list.

Moves the highlighted field down in the Selected Fields list.

Direction	Specify the direction you want the fields to populate--Horizontal places controls side-by-side; Vertical places them in a column.

Band to Populate	Select the Band to Populate from the drop-down list.

OK	Populated the selected fields. All the fields are placed on the report in the selected band. You can move any field(s) or edit their properties, if you wish.

Cancel	Cancels the Auto Populate operation.


Select Total Field Dialog

This Wizard option allows you to specify the fields you wish to total on a report. The wizard creates a Grand Totals band and places the control in that band.

Control	What it Does

Available Fields	Lists the fields available for totaling.

Selected Fields	Lists the fields selected for totaling.

Adds a field to the Selected Fields list.

Adds all fields to the Selected Fields list.

Removes a field from the Selected Fields list.

Removes all fields from the Selected Fields list.

OK	Creates the Total Fields and returns to the Wizard.

Cancel	Cancels the operation.


Report Properties Dialog

Control	What it Does

Report Label	Specifies the unique identifier ReportWriter uses for each report. The Label can contain only alphanumeric characters (letters or numbers) or the underscore ( _ ) character, and must begin with a letter. Spaces are not allowed. The maximum length is 40 characters. Each field name must be unique. There can be no duplicate names within a report.

Description	Although optional, the description can help you identify the Report in the  Library. This description displays in the Report Library list.

Library Properties
Calls the Report Library Properties dialog.

OK	Saves your modifications and returns to the Report Formatter.

Cancel	Cancels the operation.


Report Library Properties

This dialog allows you to change some of the Report Library properties. You cannot modify the filename or the original source (Created From) properties. To rename a library file, use the File [image] Save As menu command from the Report Library window.

Control	What it Does

Filename	Allows you to view the DOS filename for the Report Library. You cannot modify this.

Description	Although optional, the description can help you identify the Report in the  Library.

Password	Type a password in the Password field if you want password protection for your library.Password protection is optional and prevents unauthorized access to this set of reports. No one can modify this set of reports without the password.

Using a password encrypts the Report Library File (.TXR) , preventing anyone from viewing it in a text editor. If you want encryption without a password, use a single asterisk (*) as the password. This prevents casual viewing in a text editor without requiring a password.

Developer Password
Type a password in the developer Password field if you want password protection for Developer Mode. This password protection is optional and prevents anyone from changing from End-User Mode to Developer Mode without the password. If a Developer Mode password is supplied without a Password for the report library, the Report Library file (.TXR) is encrypted using an asterisk (*) for the password as explained above.

End-User Mode	When checked, this specifies that the report library is in End-User Mode.


About Box

Displays the program's version number and copyright information.


Image Control Dialog

Control	What it Does

File	Use this entry if the Image's source is a file on disk. Type in the filename or use the ellipsis (...) button to select it from a file dialog.

Field	Use this entry if the Image's source is a field (a binary MEMO or BLOB) in one of your data files.Type in the field label or use the ellipsis (...) button to select it from a list. The field must contain an image in a supported graphic format.

Maintain Aspect Ratio
If you want the image to scale to the correct proportions, check the Maintain Aspect Ratio box.

This sets the Height Property to the size of the control and the Width property to 0. These settings mean the IMAGE will resize the width to scale the image properly to the Height depending on the image source.

Ok	Accepts your entries and continues.

Cancel	Cancels the operation.


User Options dialog
 Click on a tab to see its help

ReportWriter lets you specify your personal preferences for the Report Formatter's appearance, displays, and system behavior. These settings are saved and remain in effect until you modify them again.

Option settings are global, that is they are not specific to a single report. However, you can change them while editing a report.

To modify your options from the Report Library or the Report Formatter choose Report [image] Options. The Options dialog appears displaying four tabs. Each of these tabs lets you modify specific Report Formatter options.

Grid

Enable Grid	Enables grid markers. These provide visual marks to assist you in control alignment.

Snap to Horizontal	Specifies "snap to" behavior for control placement and movement. If enabled, controls adhere to the horizontal markers on the grid. If disabled, controls can freely move along the horizontal axis.

Interval	Specifies the space between the grid markers for the horizontal axis.

Origin	Specifies the point of origination for the grid along the horizontal axis.

Snap to Vertical
Specifies "snap to" behavior for control placement and movement. If enabled, controls adhere to the vertical markers on the grid. If disabled, controls can freely move along the vertical axis.

Interval	Specifies the space between the grid markers for the vertical axis.

Origin	Specifies the point of origination for the grid along the vertical axis.

Display

Measurement Units
Specifies the unit of measurement for report layout. The choices are : 1/1000th of an inch, 1/10th of a millimeter, or points (1/72 of an inch).

Show Obscured Controls
Allows controls which are covered by other controls to show through.

Frame Inactive Controls
Displays a box around controls which are not currently selected.

Frame Inactive Bands
Displays a box around bands which are not currently selected.

Field Display	Lets you specify what displays in data fields on the report. The choices are:

Use Field Name	Displays the name of the field.

Use Field Picture	Displays field picture tokens.

Use Example	Displays any sample text you place in the Example entry box.

Listbox Display

To edit File or Field Descriptions in the Report Formatter, select Report File Schematic, highlight a field, then press the Edit button. You must be in Developer Mode to edit File or Field Properties. For more information see Edit Field Properties and Library Properties.

File Description Only	When checked files are displayed as their description only rather than as 'label' or 'label -description'. If there is no description then the label is displayed.

Field Description Only:
When checked fields are displayed as their description only rather than as 'label' or 'label -description'. If there is no description then the label is displayed.

Prefix Field With File: -
When checked the file is prepended to field names wherever the file cannot be contextually determined (this is the default mode). If descriptive modes are being used and all field names are unique then this option may be unchecked in order to minimize the name length and reduce display clutter.

Colors

Control Frame	Lets you change the color of the frame around controls. Press the ellipsis (...) button to select a color from a standard Windows Color Dialog.

Active Frame	Lets you change the color of the frame around the currently active element of the report. Press the ellipsis (...) button to select a color from a standard Windows Color Dialog.

Multiple Selection	Lets you change the color of the frame around multiple selected controls. Press the ellipsis (...) button to select a color from a standard Windows Color Dialog.

Current Band	Lets you change the color of the frame around the currently active band. Press the ellipsis (...) button to select a color from a standard Windows Color Dialog.

Other Band	Lets you change the color of the frame around the inactive bands. Press the ellipsis (...) button to select a color from a standard Windows Color Dialog.

Resize Handle	Lets you change the color of the resize handle on the currently active element of the report. Press the ellipsis (...) button to select a color from a standard Windows Color Dialog.

Obscured Control	Lets you change the color of obscured controls. Press the ellipsis (...) button to select a color from a standard Windows Color Dialog.

Vertical Guide	Lets you change the color of the Vertical Guides. Press the ellipsis (...) button to select a color from a standard Windows Color Dialog.

Horizontal Guide	Lets you change the color of the Horizontal Guides. Press the ellipsis (...) button to select a color from a standard Windows Color Dialog.

System

Limit Preview to	Specifies the number of pages displayed in Preview Mode. To view all pages in the report, set this to zero (0).

Open Last Library on Startup
Specifies that the last Report Library you worked on will reopen when you start ReportWriter.

Make Backup Files	Specifies to make backup copies of Report Libraries while editing. If enabled, a backup copy is save using a .BKR extension.

Autosave on Close	Specifies to save Report Libraries automatically when closing.

New Report Wizard
Lets you specify the settings the Report Wizards use when creating new reports.

Minimum Column Gap
The minimum size of the space between columns.

Maximum Column Gap
The maximum size of the space between columns.

Minimum Prompt Gap
The minimum size of the space between a field and its prompt.

Keyboard Move Increment
Lets you specify the distance a selected item moves each time you move an item using an arrow key on the keyboard.

Guide Snap Range	Lets you specify the proximity to a grid point which causes the control to snap to the grid.

Mouse Movement Threshold
Lets you specify the distance a control must move before it redisplays. This reduces "bounce" while moving items with a mouse.


File Search Paths dialog

ReportWriter looks for files in the current working directory. If your data files are in another directory, you must specify the location in the Search Paths dialog. From the Report Formatter, choose Report [image] Search Paths.

Control	What it Does

New Path	Allows you to specify a new path for the specified file(s). This calls the Edit Search Path window.

Edit Path	Allows you to modify the search path for the highlighted entry. This calls the Edit Search Path window.

Delete Path	Allows you to delete the search path for the highlighted entry.

Allows you to move the highlighted entry up in the list. ReportWriter uses the order in the list to locate files. It always uses the first one found.

Allows you to move the highlighted entry down in the list. ReportWriter uses the order in the list to locate files. It always uses the first one found.

Close	Closes the window.


Edit Search Path

Control	What it Does

Name/Mask	The file or file mask for this path. Type in the entry or use the ellipsis button to select a file from a standard file dialog. You can use wildcards (? or *) to specify multiple files with similar names or extensions. For example *.TPS specifies all files with the .TPS extension.

Directory	The directory to add to the search path for the specified file(s).

Relative Path	If you want to specify a directory relative to the working directory, check this box.


Constant Text/Value dialog

This dialog allows you to enter constant text, or a constant number, time or date. Type in the value, then press the OK button.


New Field total dialog

1.	Select the field to total from the list on the left. If necessary, change the file by selecting a different one from the drop-down list.

2.	Select the total Type from the drop-down list (Sum, Average, Count, Max, or Min). See Also: Total Types .

3.	Type the picture for the field in the Picture field, or press the ellipsis (...) button to use the Picture Editor.

This specifies how the total field's value displays.

4.	Select the Tally On choice from the drop-down list.

The choices are PAGE, ALL, or any Group Breaks defined in the report. If you choose PAGE, the total computes every time page overflow occurs. If you choose ALL, the total computes every time the Detail Band prints. If you choose a Group Break, the total computes every time the group break occurs.

5.	Select the Reset On choice from the drop-down list.

The choices are PAGE, NONE, and any Group Breaks defined in the report. If you choose PAGE, the total resets every time page overflow occurs. If you choose NONE, the total resets only when the report is completed. If you choose a Group Break, the total resets every time the value of the group break field changes.

Your Tally On and Reset On choices should never be the same. If they are the same, you have told ReportWriter to tally and reset the total at the same time--the total will always be zero.

6.	Press the OK button.

7.	CLICK on the Report at the location where you want the total field.


Password dialog

If a Report Library is password protected, this dialog appears. Enter the password, then press the OK button.


Select Runtime Variable

This window allows you to select one of your runtime fields to use as a range limit. Highlight the variable you would like to use and press the Select button.

To create a new Runtime Field variable, press the New button.


Serial Number Validation Dialog

You must provide your Name, Company Name and Serial Number before you can run ReportWriter. Your Serial Number is on your Registration Card.


New Total

Control	What it Does

Label	The unique label ReportWriter uses for the field. The Label can contain only alphanumeric characters (letters or numbers) or the underscore ( _ ) character, and must begin with a letter. Spaces are not allowed. The maximum length is 40 characters. Each field name must be unique. There can be no duplicate names within a report.

Description	A description for yur Total field. A description can help you identify the field.

Picture	Type the picture for the field in the Picture field, or press the ellipsis (...) button to use the Picture Editor.

Field to Total	Select the Field to Total by pressing the ellipsis (...) button.

The Field Selection window appears. Highlight the field on which to base the calculation, then press the Select button.

Tally On	Select the Tally On choice from the drop-down list box.

The choices are PAGE, ALL, or any Group Breaks defined in the report. If you choose PAGE, the total computes every time page overflow occurs. If you choose ALL, the total computes every time the Detail Band prints. If you choose a Group Break, the total computes every time the group break occurs.

Reset On	Select the Reset On choice from the drop-down list box.

The choices are PAGE, NONE, and any Group Breaks defined in the report. If you choose PAGE, the total resets every time page overflow occurs. If you choose NONE, the total resets only when the report is completed. If you choose a Group Break, the total resets every time the value of the group break field changes.

Your Tally On and Reset On choices should never be the same. If they are the same, you have told ReportWriter to tally and reset the total at the same time--the total will always be zero.

Type	Select the total Type from the drop-down list (Sum, Average, Count, Max, or Min).


New Conditional Field

Control	What it Does

Label	The unique label ReportWriter uses for the field. The Label can contain only alphanumeric characters (letters or numbers) or the underscore ( _ ) character, and must begin with a letter. Spaces are not allowed. The maximum length is 40 characters. Each field name must be unique. There can be no duplicate names within a report.

Description	A description for your Total field. A description can help you identify the field.

Picture	Type the picture for the field in the Picture field, or press the ellipsis (...) button to use the Picture Editor.

If Formula	Press this button to use the Formula Editor to create the condition to evaluate.

Then Formula	Press this button to use the Formula Editor to create the expression to use when the condition is true.

Else Formula	Press this button to use the Formula Editor to create the expression to use when the condition is false.


New Computed Field

A computed field is a field whose value is determined by the result of an expression. This is similar to an assignment statement in most programming languages. The computed field is assigned the value from the expression.

Expressions can range from the very simple to very complex. For example a computed field to return today's date uses the formula:

TODAY()

For a computed field to calculate the tax for an invoice, one possible formula might be

SubTotal * TaxRate.

All of these expressions are created in the Formula Editor, which produces the correct syntax for the expression.

Control	What it Does

Label	The unique label ReportWriter uses for the field. The Label can contain only alphanumeric characters (letters or numbers) or the underscore ( _ ) character, and must begin with a letter. Spaces are not allowed. The maximum length is 40 characters. Each field name must be unique. There can be no duplicate names within a report.

Description	A description for your Total field. A description can help you identify the field.

Picture	Type the picture for the field in the Picture field, or press the ellipsis (...) button to use the Picture Editor.

Formula	Press this button to create the formula with the Formula Editor.


New Runtime Field

Control	What it Does

Label	The unique label ReportWriter uses for the field. The Label can contain only alphanumeric characters (letters or numbers) or the underscore ( _ ) character, and must begin with a letter. Spaces are not allowed. The maximum length is 40 characters. Each field name must be unique. There can be no duplicate names within a report.

Description	A description for your Runtime field. A description can help you identify the field.

Picture	Type the picture for the field in the Picture field, or press the ellipsis (...) button to use the Picture Editor.

User Prompt	The prompt the user sees when asked to enter a value for the runtime field.

Default Value	The default value for the Runtime Field. When the user runs a report, this value is provided in the entry field for the variable. The user can accept this value by pressing the OK button, or can provide a new value by typing it in.

Validation Formula
Press this button to create the formula with the Formula Editor. This enables validation at runtime, allowing only valid values as specified in the formula.

Error Message	The message displayed when a user enters an invalid value at runtime.


Select Break

This dialog allows you to choose the Group Break for which you want a Header or Footer created.

Highlight the Group Break you want to use, then press the Select button.

If the Group Break you want has not yet been created, press the Sort Order button to create a new break.


New Report Wizard - Fields to Populate

Control	What it Does

Available Fields	This list displays the fields available for your report. Select the file you want in the drop-down list. The file's available fields appear in the list box.

Selected Fields	This list displays the fields you have selected to populate on the report.

Adds the highlighted field to the Selected Fields list.

Adds all Available Fields to Selected Fields list.

Removes the highlighted field from the Selected Fields list.

Removes all Selected Fields from the current file from the list.

Moves the highlighted field up in the Selected Fields list.

Moves the highlighted field down in the Selected Fields list.

Next >	Continues to the next wizard dialog.

<Back	Returns to the previous wizard dialog.

Cancel	Cancels the Wizard operation.


New Report Wizard - Sort Order

Control	What it Does

Order By	Select an option from the drop down list. The choices are the keys defined in the Data Dictionary, Record Order, and one for USER DEFINED ORDER. If no defined key fits the sort order, the USER DEFINED ORDER allows you to create a sort order used only by this report (see Creating a User Defined Order).

Sort Fields	Lists the fields by which your report is sorted.

Ascending	Specifies the sort order is from lowest to highest.

Descending	Specifies the sort order is from highest to lowest.

Case Sensitive	Specifies that case is considered when sorting.

When a field contains numeric data, you always want to consider it in a Case Sensitive manner. When case is ignored, numbers are sorted alphabetically.

Group Break	Checking this box adds a Group Break fro the highlighted field. To remove a Group Break, highlight the field and uncheck the box.

Exclude Nulls	Specifies that only records which are not zero or blank are considered.

Add	Adds a field to the list (only available in a user-defined sort).

Delete	Removes a field from the list (only available in a user-defined sort).

Moves a field up in the list (only available in a user-defined sort).

Moves a field down in the list (only available in a user-defined sort).

Ranges	Allows you to set range limits for the report.

Next >	Continues to the next wizard dialog.

<Back	Returns to the previous wizard dialog.

Cancel	Cancels the Wizard operation.


New Report Wizard - Label Types

This Wizard dialog allows you to select a label type from the list of supported labels. If the labels you are using do not appear on the list, you can create a Custom label definition using the spin controls on the right.

Highlight the label type in the list, then press the Next> button.


New Report Wizard - Report Layout

Control	What it Does

Paper Size	This field allows you to specify one of a number of common paper sizes. In most cases, you will use the Current Printer Setting.

Orientation	This field allows you to specify one the paper's orientation--Portrait or Landscape.

height x width	This field allows you to specify the dimensions of a paper size not listed.

Title Page	Type in the text you want to print on a Title Page. If omitted, ReportWriter does not create a Title Page for the report.

Field Separators	Select the type of separators you want from the drop-down list.

Group Indent	Specifies the amount of indention for each group level.

Page Number	Check this box to print page numbers in a Page Footer on each page of the report.

Line Spacing	This field allows you to specify whether the report is line-based or free form. Choose from:

Free Format	Free format spacing

Single	Single Line spacing

1.5 Lines	Line and a half Spacing

Double	Double Line spacing

Custom	Custom Spacing. Specify the size in the control to the right.

This determines how the controls are populated.

Page Margins	This field allows you to specify the margins of the printed page.

Fonts	Press this button to specify fonts for any band on the report. See: Wizard fonts dialog .

Totals	Press this button to specify any fields you want to total on the report. See: Select Total Field Dialog.

<Back	Returns to the previous wizard dialog.

Cancel	Cancels the Wizard operation.

Finish	Creates the report with the information you have supplied.


Range Limits

This dialog allows you to specify the Range Limits for the selected field. These are inclusive limits.

Control	What it Does

Low	The lower limit for the range.

No Limit	No low limit. The lowest possible value is used.

Value	A constant value to use as the lower bound.

Runtime Variable	Press this button to select a Runtime field. The value entered at runtime is used as the lower limit.

High	The upper limit for the range.

No Limit	No high limit. The highest possible value is used.

Value	A constant value to use as the upper bound.

Runtime Variable	Press this button to select a Runtime field. The value entered at runtime is used as the upper limit.

Ok	Accepts your entries and continues.

Cancel	Cancels the operation.


Total Types

There are five types of "total" fields: Sum, Average, Count, Max, and Min.

A Sum field keeps a running total of the field selected as the Use Field.

An Average field totals the Use Field and divides that sum by the number of fields processed, resulting in the arithmetic mean (average value) of that field.

A Count field tallies the number of times the Use Field is printed.

A Min or Max field evaluates and stores the minimum or maximum values of the Use Field, respectively.


Field Properties

This dialog allows you to edit the manner in which Files and Fields display in ReportWriter (depending on the Display Options you have chosen). You can also modify a field's default print format (picture).

You must be in Developer Mode to edit File or Field Properties. For more information see Edit Field Properties and Library Properties.

Control	What it Does

File	This section defines the properties for a file. The file's name is shown here.

Description	This defines the file's description. This displays in ReportWriter when specified in the User Options dialog.

Hidden from End-User	Specifies that the file not be shown when ReportWriter is in End-User mode (see Report Library Properties).

Field	This section defines the properties for a field. The field's name is shown here.

Description	This defines the field's description. This displays in ReportWriter when specified in the User Options dialog.

You can also specify  'short' and 'full' display descriptions. These are set by using a description of the form: 'shortdesc|fulldesc', i.e., the short form is separated from the full description by the vertical bar ( | )' character. Short descriptions are used in field names and full descriptions are used in listboxes where a more verbose description is useful.

Hidden from End-User	Specifies that the field's not be shown when ReportWriter is in End-User mode (see Report Library Properties). This is useful to hide fields containing sensitive data from some users in order to maintain security.

Ok	Accepts your entries and continues.

Cancel	Cancels the operation.


External Procedures and Variables

This list allows you to define functions and variables in an external dynamic link library (.DLL). Once defined, the externals can be incorporated into any formula (e.g., a computed fields) by selecting the correct external from the Externals list in the formula editor. The description displayed in the formula editor tree is the User Description entered when creating the external and can contain parameter descriptions for easy reference.

During report printing, functions are called every time a formula using that function is used.

Externals are shared by all reports in a Report Library. They only need to be defined once for each library.

Control	What it Does

New External	Adds an external function or variable to the list.

Edit External	Allows you to modify the definition of an external function or variable in the list.

Delete External	Removes an external function or variable from the list.

Moves an external function or variable up in the list.

Moves an external function or variable down in the list.

See Also:

External Function or Variable


External

This window allows you to define a function or variable in an external dynamic link library (.DLL).

Once defined, this external can be used in any formula (e.g., a computed fields) by selecting it from the Externals list in the formula editor.

During report printing, functions are called every time a formula using that function is used.

Control	What it does

Name	The name of the function or variable in the formula.

User Description	The description displayed in the formula editor tree. This can contain parameter descriptions for easy reference.

Function	Check this box if the external is defined as a FUNCTION. If not checked, the Number of Parameters is hidden and the String Size dialog is available.

Number of Parameters
The number of parameters for the function (only available when the Function box is checked). Functions can have between 0 and 16 parameters. Each parameter must be a STRING. The return data type is also a STRING.

String Size	Only available when the Function box is unchecked. Specify the size of the string variable. External variables must be STRING data types and the size must match that specified.

DLL Name	The filename (without extension or directory path) of the DLL. The DLL must be in the same directory as the print engine or in the PATH.

You can use the macros %X% and %S% to differentiate between 16 and 32 bit DLLs. i.e. At report print time %X% expands to nothing and %S% to '16' if the report is being run in 16-bit. In 32-bit mode,  X% expands to 'X' and %S% to 32.

Entry Point	This specifies either the ordinal number or (preferably) the name of the exported function or variable. This must match the name in the EXP file when creating the external DLL.

In 32-bit mode, only the name form is supported also names *must* be exported all uppercase.


Common Questions

Using the Report Wizards

Freeform, Table, or Form Wizard

Label Wizard

Specifying the File Schematic for a Report

Creating a User Defined Relationship

Accessing a Single Record File

Specifying the Report Order

Creating a User Defined Order

Defining Group Breaks

Using Range Limits

Filtering a Report

Conditional Bands

Placing Image Fields on a Report

Moving Controls on a Report

Copying, Cutting, and Pasting Controls on a Report

Deleting Controls from a Report

Auto-Populating a Band on a Report

Controlling Pagination

Variable Length Memos on Reports

Placing Text on a Report

Lines, Boxes, Circles

Using the Runtime Print Engine

C60PRINT Command Line Parameters

Using C60PRINT with an Initialization File

Distributing your Reports

Importing File definitions from a Multiple Table .TPS File

Report-Specific Fields

Using Total Fields

Creating Total Fields (Total Wizard)

Creating Total Fields (Standard Method)

Using Computed Fields

Using Conditional Fields

Creating a Runtime Field


Using the Report Wizards

Clarion ReportWriter for Windows has built-in wizards to create reports quickly. This enables you to provide a little information and have a fully-functional report created. After you create a report using a wizard, you can modify it with the Report Formatter. This provides both rapid report prototyping and flexibility.

There are four Report Wizards:

Table	Creates a columnar report.

Form	Creates a form-based report.

Label	Creates a multi-up column report, most commonly used to print labels.

Freeform	Creates a freeform report that you can modify in any manner. This wizard populates no fields, providing you with a "blank slate" to create reports.

To create a report using a Report Wizard:

1.	From the Report Library, press the New button.

The first wizard screen appears. This is where you supply the report's label, a description, select the Report Wizard style and the files the report will use.

2.	Add files to the File Schematic by pressing the Add button.

3.	Fill in the first wizard window, then press the Next > button.

The second wizard window appears. This is where you specify which fields to populate on the report. If you chose the Freeform Wizard, skip to the next section. The Freeform Wizard does not populate any fields.

4.	Specify the fields to populate, then press the Next > button.

The third wizard window appears. This is where you specify the Sort Order, Range Limits, and Group Breaks for the report.

5.	Specify the Sort Order and Group Breaks for the report.

6.	If you want to limit the report's scope, press the Range button and, set the Range Limits you want, then press the OK button.

7. Press the Next > button.

The remaining wizard windows depend on which style you chose on the first wizard screen.

Next:

Freeform, Table, or Form Wizard

Label Wizard


Freeform, Table, or Form Wizard

The next wizard window appears. This is where you specify report design options.

1.	Select the Paper Size from the drop-down list.

2.	Select the Orientation from the drop-down list.

This determines whether the report is Portrait or Landscape.

3.	Optionally, set the paper Width and Height.

If the paper you are using was in the drop-down list, this is automatically set for you.

4.	Optionally, provide the text to place on a title page (if omitted, no title page is created for you).

5.	Select the desired Field Separators from the drop-down list.

This determines the type of lines placed on your report.

6.	Set the amount of indentation you want for groups using the spin control.

This determines the amount each level is indented when you create a relational report with group breaks.

7.	If you want page numbering, check the Page Numbering box.

This creates a Page Footer and places a page number control in the band.

8.	Select the Line Spacing from the drop-down list.

The choices are:

Free Format

Single

1.5 Lines

Double

This determines how the controls are populated.

9.	Optionally, select a Font for elements of the report by pressing the Font button.

This determines the Font used for controls on each band of the report, unless a font is specified a specific control. Optionally, you can set any of these fonts as the wizard's default.

10.	Optionally, select fields to total by pressing the Totals button.

This creates a Grand Total Band and places Total Fields on it.

11.	Optionally, set the page margins.

12.	When you have provided all the information, press the Finish button.

The report appears in the Report Formatter, ready to run or modify.


Label Wizard

The next wizard window appears. This is where you select the type of label.

1.	Select the label type from the list.

This determines the basic size, and configuration of a sheet of labels. If the labels you are using do not appear, design your own by choosing Custom, then define the label specifications on the right.

2.	Press the Next > button.

The Report Layout window appears. This allows you to specify the Page Size, Orientation, and Margins.

3.	If you want field labels to appear, check the Prompts box. If not, clear the check box.

4.	Optionally, specify the font to use by pressing the Fonts button.

5.	Press the Finish button.

The report appears in the Report Formatter, ready to run or modify.


Specifying the File Schematic for a Report

The File Schematic specifies the files used for the report. Reports use one Primary file and multiple levels of related files.

The File Schematic also lists the available report-specific fields. Report-specific fields are the computed, conditional, total, or runtime fields that have been defined for a report. Report-specific means they are only available for the report in which they are defined.

Before specifying a file schematic, decide which file will be the primary file and which related files you will need for the report.

1.	Click on the [image] button or choose Report [image] File Schematic.

The File Schematic Definition window appears. This contains a list box which displays all the files used in a report. The list box displays in a tree format with two sections: Files and Other Data.

2.	With the File Schematic band (in the Files list box) highlighted, press the Add File button.

The Select Primary File window appears, displaying a list of all the files in the Report Library.

3.	Highlight the file and press Select.

If you are using only a primary file, you can skip the remaining steps.

4.	Highlight the file to which you want to attach a related file.

5.	Press the Add File button.

The Select File window appears. This window displays the files that are related to the Primary file (defined in the Data Dictionary on which the Report Library is based) in the Related Files section.

6.	Highlight the related file in the Related Files section and press the Select button.

The file schematic now displays the files and their relationships. The top file is the Primary file, any other files are Secondary files.

Secondary files are directly related to the file above it in the schematic. A double right arrow indicates that the Secondary file is the Child of the file to which it is connected. A single right arrow indicates that the Secondary File is the Parent of the file to which it is connected.

If you want to add more related files, repeat the last step.

7.	When all the files are in the schematic, press the OK button.


Creating a User Defined Relationship

Files can be joined in a Data Dictionary if the files contain the necessary keys. If these relationships have not been defined in a Data Dictionary or your report is not based on a Data Dictionary, you can create a user-defined relationship in a report's file schematic.

You can also use a User-defined relationship to access a single record file which is not related to any files in your schamatic (see Accessing a Single Record File).

Tip: 	This is particularly useful when joining files created with file systems that do not support keys (such as ASCII or BASIC).

The two files must have fields which contain identical data to use as a link between them. The files must be in the File Schematic specified for the report.

Before specifying a file schematic, choose the primary file and identify the related files needed for the report.

1.	Click on the [image] button or choose Report [image] File Schematic.

The File Schematic Definition window appears. This contains a list box which displays all the files used in a report. The list box is divided in two sections: Files and Other Data.

2.	With the File Schematic band highlighted, press the Add File button.

The Select Primary File window appears, displaying a list of all the files in the selected dictionary.

3.	Highlight the desired file and press Select.

4.	Highlight the file from which to attach another file.

5.	Press the Add File button.

The Select File window appears. This window has 2 sections: Related Files and User-defined Related Files. The first section displays the files that have defined relations to the Primary file in the Database Dictionary. The second lists all the remaining files in the Report Library.

6.	Highlight the related file in the User Defined Related Files section and press the Select button.

The User Defined Relationship Properties window appears.

7.	Select either the 1 to Many or Many to 1 button.

8.	Press the Add button.

The Link Fields window appears. This window contains two drop-down lists containing all the fields in the two files.

9.	Select the Link From field from the drop-down list.

10.	Select the Link To field from the drop-down list.

11.	Check the Case Sensitive box, if you don't want to ignore case.

NOTE: 	When a field contains numeric data, you always want to consider it in a Case Sensitive manner. When case is ignored, numbers are sorted alphabetically.

12.	Press the OK button.

The link appears in the Link Fields list box in the User Defined Relationship Properties window.

13.	For additional links, repeat the last 5 steps.

14.	Press the OK button.

The file schematic now displays the files and the user-defined relationship. The top file is the Primary file, any other files are Secondary files.

Secondary files are directly related to the file above it in the schematic. A double right arrow indicates that the Secondary file is the Child of the file to which it is connected. A single right arrow indicates that the Secondary File is the Parent of the file to which it is connected.

15.	When all the files are in the schematic, press the Close button.


Accessing a Single Record File

You can now use a single record (control) file which is  not related to any other files by adding the file as a user-defined relation and not specifying any link fields. This allows you to populate fields from that file to print data from the first record in the file.

1.	Click on the [image] button or choose Report [image] File Schematic.

The File Schematic Definition window appears. This contains a list box which displays all the files used in a report. The list box is divided in two sections: Files and Other Data.

2.	With the primary file highlighted, press the Add File button.

The Select File window appears. This window has 2 sections: Related Files and User-defined Related Files. The first section displays the files that have defined relations to the Primary file in the Database Dictionary. The second lists all the remaining files in the Report Library.

3.	Highlight the single record file in the User Defined Related Files section and press the Select button.

The User Defined Relationship Properties window appears.

4.	Press the OK button (without specifying any link fields).

A warning appears to let you know that you have not specified any links.

5.	The link appears in the Link Fields list box in the User Defined Relationship Properties window.

The file schematic now displays the files and the new "user-defined relationship". Populating any fields from this file will get the values from the first record in that file.


Specifying the Report Order

1.	Click on the  button or choose Report [image] Sort Order.

The Sort Order window appears.

2.	Select the desired Sort Order type from the drop-down list in the Order By field.

The drop-down list contains the keys defined in the Data Dictionary, Record Order, and one for USER DEFINED ORDER. If no defined key fits the sort order, the USER DEFINED ORDER allows you to create a sort order used only by this report (see Creating a User Defined Order).

NOTE: 	If you change the Sort Key for a report containing Range Limits, you will lose any Range Limits you have set.

3.	Optionally, specify any group breaks by highlighting the field to break on and checking the Group Break Box beneath the list.

4.	Press the OK button.

See Also:

Creating a User Defined Order


Creating a User Defined Order

If no key in the Database Dictionary fits the sort criteria you would like to use, you can create your own. This allows you to sort the data on any field.

1.	Click on the  button or choose Report [image] Sort Order.

The Sort Order window appears.

2.	Select the User Defined Order from the drop-down list in the Order By field.

The drop-down list contains the keys defined in the Data Dictionary, Record Order, and one for USER DEFINED ORDER. If you find that an existing key fits the sort criteria, you can select that one. If not, you can continue creating your own.

5.	Press the Add button.

The Fields Selection window appears.

6.	Select the sort field from the Fields list box, then press the Select button. You can select from any file in the file schematic.

7.	With the field highlighted, check the appropriate boxes to specify the properties of the user-defined sort. The choices are:

Ascending	Mark this button to specify the records are to be sorted from lowest to highest.

Descending	Mark this button to specify the records are to be sorted from highest to lowest.

Case Sensitive	If checked, ReportWriter performs a case sensitive sort. If not checked, case is ignored.

NOTE: 	When a field contains numeric data, you always want to consider it in a Case Sensitive manner. When case is ignored, numbers are sorted alphabetically.

Group Break	Check this box to cause a group break on this field. (See Defining Group Breaks)


Defining Group Breaks

Group breaks determine how data is grouped together in a report. Grouping data in different ways produces reports that can provide valuable business information.

For example, if you set a group break on the STATE field, data would print out with all records with the same state name grouped together. If you add a group break on the City field, you could have all the records with the same city name grouped together within the state grouping.

The Group Headers and Group Footer bands allow a place for titles, subtotals, and totals. Using these group breaks, you could print a sales report by city and state, with totals for each city and totals for each state.

Once you have determined the grouping you want for your report, you can set the group breaks.

1.	Click on the  button or choose Report [image] Sort Order.

The Report Sort window appears, displaying a list of all the fields that are available for group breaks. These fields are all components of the keys which link the files. Only linking fields can be used as group break fields.

2.	Highlight the field to break on and check the Group Break box.

If you want more than one group break on the report, repeat the last step for each field the report should break on.

3.	Press the OK button.

The Report Formatter now shows bands for the Group Header for each break field specified. You can also add Group Footer bands for any of these groups breaks.


Using Range Limits

You can reduce processing time by using a subset of the data file that only contains the records you need. Range Limits define this subset. ReportWriter allows you to define multiple ranges, so that you can access data within more than one range.

A simple range limit could, for example, limit the scope to access only those records from one state. Using a multiple range, you could access the records for two states. You can also select a Runtime Field as a Range Limit Value.

1.	Click on the  button or choose Report [image] Sort Order.

The Report Order window appears.

2.	Press the Ranges... button.

3.	Highlight the field to limit, then press the Edit button.

The Range Limits window appears.

4.	Type the low limit value for the range to consider in the Enter Low Value field.

Selecting the No Low Value radio button specifies that the low-end of the limit is the lowest possible value for the field's data type.

5.	Type the low limit value for the range to consider in the Enter High Value field.

Selecting the No High Value radio button specifies that the high-end of the limit is the highest possible value for the field's data type.

6.	Press the OK button.

7.	For additional ranges, press the Insert Range button and repeat the last three steps.


Filtering a Report

Records can be filtered so they only print if they meet a certain criteria. This produces a report containing only the information you want.

Records can be filtered in many different ways. For example, you might want a report of "widget" sales in 1989, but only if the total sale exceeded $1,000. The file contains sales data for many products and several years of sales.

Using the filter below, only those records print.

Year = 1989 AND Item = 'Widget' AND Sale > 1000.00

To set a record filter:

1.	Click on the  button or choose Report [image] Record Filter.

The Record Filter window appears with a built-in Formula Editor. This allows you to create a syntactically correct expression. With the Formula Editor, you add components one-by-one from a list of the available components. The Formula Editor offers only valid options every step of the way.

Since a record filter requires that a certain condition be met, the Formula Editor creates a Conditional expression. A conditional expression is evaluated as true or false. For example, the expression: Date < 06/07/1996 is true if the value of the Date field is 06/06/1996 or less. If it is greater than or equal to 06/07/1996, then the expression is false.

2.	Create a condition with the Formula Editor.

3.	Press the OK button.

ReportWriter now checks the condition as each record is read and only processes those that evaluate true.


Conditional Bands

You can place a condition on a band so it prints only if a certain criteria is met.

For example, you might want to print one band for customers in your state, and a different band for out-of-state customers. You would create a second detail band, set a band condition on each— one to print if State = YourState, the other to print if State <> YourState.

To set a Band Print filter:

1.	Select the band.

2.	Open the Property List (by CLICKING on the  button on the toolbar).

3.	Click on the Condition property, then press the ellipsis (...) button next to Condition.

The Formula Editor appears. The Formula Editor enables you to create a syntactically correct expression. In the Formula Editor, you add components one-by-one from a list of the available components. The Formula Editor offers only valid options every step of the way.

Since a band print filter checks if a certain condition is met, the Formula Editor creates a Conditional expression. A conditional expression evaluates as true or false. For example, the expression: Date < 06/07/1996 is true if the value of the Date field is 06/06/1996 or less. If it is greater than or equal to 06/07/1996, then the expression is false.

4.	Create a condition with the Formula Editor

5.	Press the OK buttons on the Generate Expression and the Band Properties windows.

ReportWriter now evaluates the condition before printing the band and only prints it when the condition is true.


Placing Image Fields on a Report

ReportWriter supports printing graphic images from several sources.

The image's source can be a file or a binary memo or BLOB field which contains the image data. If a Memo or BLOB contains the data for a graphic, ReportWriter automatically interprets its format and prints the image. This allows you to store any supported graphic in a binary memo or BLOB and print the image it contains.

The following graphic formats are supported:

Graphical Interchange Format	.GIF

.JPG

Bitmap Graphics	.BMP

Windows MetaFile	.WMF

PaintBrush Format	.PCX

Icon File	.ICO or .CUR

To Place an Image on a Report:

1.	Choose Control [image] Graphic Control [image] Image.

2.	Click on the report at the location where you want the image to appear.

3.	Specify the Image Source.

4.	If you want the image to scale to the correct proportions, check the Maintain Aspect Ratio box.

This sets the Height Property to the size of the control and the Width property to 0. These settings mean the IMAGE will resize the width to scale the image properly to the Height depending on the image source.

5.	Press the OK button.


Moving Controls on a Report

The Report Formatter allows you to move items easily. All you have to do is CLICK-AND-DRAG with the mouse. In addition, if a control is selected, you can "nudge" it with the cursor keys. Each press of a cursor arrow key moves the control in the direction of the arrow.


Copying, Cutting, and Pasting Controls on a Report

The Report Formatter allows you to copy or cut items and paste them into any band. This allows you to move a control from one band to another. If you want to move a control to a new band, cut it, them paste it in the desired band.


Deleting Controls from a Report

1.	Select the control.

2.	Press DELETE.


Auto-Populating a Band on a Report

If you want to place several fields from a data file on a report quickly, the Auto-Populate method is the answer. Using this method, data fields are placed side-by-side. The fields can be moved afterwards, if you choose.

1.	Choose Edit [image] Auto-Populate.

The Field Selection window appears.

2.	If the file is already selected in the drop-down list, skip this step. If not, select the file in the File drop-down list.

The file's available fields appear in the Fields list box.

3.	Highlight the field you want to place on the report and press the  button (or DOUBLE-CLICK on the field). If you want to populate all the fields, press the  button.

The Data Field properties are set to the defaults from the Database Dictionary. If you want to change them, you can edit them later.

4.	Specify the direction you want the fields to populate—Horizontal places controls side-by-side; Vertical places them in a column.

5.	Select the Band to Populate from the drop-down list.

6.	Press the OK button.

All the fields are placed on the report. You can move any field(s) or edit their properties, if you wish.


Controlling Pagination

There are four properties that control the manner in which report elements span pages (pagination). Using these pagination options, you can create a report that prints in an organized manner and ensures that every page is understandable.

Page Before	Print the structure on a new page. To reset the page number to a value you specify, type it in the Page Before field. To force a Page Before without resetting the page number, specify -1.

Page After	Print the structure, then force a new page. To reset the page number to a value you specify, type it in the Page After field. To force a Page After without resetting the page number, specify -1.

With Prior	Prevents 'orphan' elements in a printout. An 'orphaned' print element is one which prints on a following page, separated from its related items. The value specifies the number of preceding elements to print—a value of "1," for example, specifies that the previous element must print on the same page. When placing subtotals or totals in a band, use the WITHPRIOR attribute to insure they print with at least one member of the column above it when a page break occurs.

With Next	Prevent 'widow' elements in a printout. A 'widowed' print element is one that prints, but then is separated from the succeeding elements by a page break. The value specifies the number of succeeding elements to print—a value of '1,' for example, specifies that the next element must print on the same page, else page overflow puts them both on the next.

You can use almost any combination of these properties to control the report's pagination.


Variable Length Memos on Reports

Memo fields are usually used to store data of varying lengths. One record may contain several lines of text in its Memo, while another may contain a few words. Typically, you will want your report to adjust to the size of the Memo. If it were a fixed size, you would have blank areas on the report.

The Report Wizard automatically creates bands to handle the varying length of a Memo Field. The report should not contain noticeable "gaps."

This is accomplished with a combination of two property settings. First the TEXT control for the Memo field is set to Auto Expand. This specifies that the Text control expand to accommodate all the data in the memo. The second property is on the Group Header Band. It is set to not be a Fixed Height. This allows the band to expand and contract to accommodate the size of the controls within the band.

To set the properties used to produce this effect:

1.	RIGHT-CLICK on the text control for the Memo, then select Properties.

2.	Set Auto Expand to Yes.

3.	Press the Close button.

4.	RIGHT-CLICK on Band, then select Properties.

5.	Set Fixed Height to No.

6.	Press the Close button.

Using these two properties, you can create expanding Memos and Bands in any report.


Placing Text on a Report

Constant or literal text can be used as report titles, page headers or footers, column headings, group headers, or report final page footers. Text can be placed on a report by using either the String or the Text Control.


Lines, Boxes, Circles

Lines, boxes, and ellipses can be used to separate groups or place borders around certain items to make them stand out. Good use of these controls improves the report's readability.

To Place a Line on a Report:

1.	Choose Control [image] Graphic Control [image] Horizontal Line or Control [image] Graphic Control [image] Vertical Line

2.	CLICK on the report at the location where you want the line to appear.

3.	Adjust the line length by dragging the handles, as needed.


Using the Runtime Print Engine

Clarion ReportWriter Report Library files (.TXR) are redistributable along with the print engine (C60PRNTX.EXE) and its supporting DLLs. This allows you to distribute the files needed for end users to print or preview reports. It does not allow any modifications to reports.

To design reports, each user must own a separate copy of Clarion ReportWriter for Windows. You can purchase ReportWriter from SoftVelocity for resale to your clients or to include with your application as part of a complete solution. This allows your customers to modify your reports or create new ones.

Note:	ReportWriter (C60RW.EXE) is not redistributable. Each user must purchase a separate copy.

See Distributing your Reports for details on deploying Report Libraries and the necessary supporting files.

The print engine (C60PRNTX.EXE) is distributable. This lets you create reports and distribute Report Libraries (.TXR files) along with the print engine to multiple users. These users will be able to run reports, preview them, and print them. However, they will not be able to modify the reports.

You can pass information to the print engine on the command line or through an Initialization (.INI) file. This tells the print engine which Report Library to use, which report to execute, plus any desired options.


C60PRNTX Command Line Parameters

C60PRNTX	[	|ReportLibraryFile	 | 	] [ReportLabel] [optionlist]
 	|INIFilename       	 |	]

ReportLibraryFile
The full path and filename of the Report Library File (.TXR).

IniFilename	The Initialization file containing all the information to pass to the print engine.

ReportLabel	The label of the report within the Report Library. If omitted, a simple list box displayed with list of available reports.

Optionlist	A list of optional parameters for the print engine.

C60PRNTX.EXE is a stand-alone executable file. You can install this file on any computer to execute reports. You can create Program Manager Icons (Windows 3.x) or Shortcuts (Windows95).

You can use the print engine in many ways to run reports. By associating .TXR files with print engine, you can enable Windows Explorer double-click functionality. For example, if C60PRNTX.EXE is associated with .TXR files, double-clicking on a Report Library file in Explorer opens the Report Library with the print engine and displays a list of reports. This also allows drag and drop functionality. By dragging a .TXR file onto a C60PRNTX icon or shortcut, you can open the report library and display a list of its reports.

You can also provide optional parameters on the command line or through an Initialization file.

     /Pstring	The report's password. For example: /P"bat123" specifies the password is bat123.

     /W[n]	Preview (n pages). If n is omitted, all pages will appear. For example: /W specifies to run in Preview mode. Another example: /W4 specifies to run in Preview Mode and only show the first four pages.

     /Dprinterdef	The Printer Name (device) as specified in the Windows Print Manager. For example /D"HP LaserJet 4/4M PostScript" specifies the HP LaserJet printer.

       /Vvarname=value
This assigns values to runtime variables. There cannot be spaces on either side of the equal sign (=). You can specify more than one matched pair on the command line. For example: /Vx=3 or /Vproduct="Widgit".

       /Iininame	The Initialization file to use.

Examples:

C60PRNTX

C60PRNTX ORDERS.TXR

C60PRNTX C:\REPORTS\ORDERS.TXR

C60PRNTX ORDERS.TXR Invoice

C60PRNTX ORDERS.TXR SalesReport /VCustNumber=23

C60PRNTX ORDERS.TXR MonthlySalesReport /P"theboss"

C60PRNTX /Iinvoice.ini

C60PRNTX /Iinvoice.ini SalesReport /VCustNumber=23


Using C60PRINT with an Initialization File
Using C60PRNTX with an Initialization File

The Initialization file is either (in order of priority):

•	The Initialization file set by the /I command line parameter.

•	The Initialization file with the same name as the Report Library being printed.

•	C60PRINT.INI found by the Windows .INI search path.

In the Initialization file, there are three sections: [Run], [Variables], and [Paths]. These contain values for the command line options. Any values specified on the command line override INI file values.

INI File Format:

[Run]

LIBRARY=libname     ! same as 1st parameter

REPORT=repname      ! same as 2nd parameter

PASSWORD=password   ! same as /P

PREVIEW=n           ! same as /Wn (if omitted all pages are previewed)

DEVICE=device       ! same as /D

[Variables]

variablename=value  ! same as /Vvariablename=value

[Paths]

mask=dirpath

INI File Example:

[Run]

LIBRARY=C:\C60\RWTUTOR\RWTUTOR.TXR

REPORT=StudentLabels

PASSWORD=SoftVelocity

PREVIEW=5

[Variables]

MajorCode=5

[Paths]

*.TPS=C:\C60\RWTUTOR


Distributing your Reports

To distribute reports to computers that do not have ReportWriter installed, you must provide the following files:

Your Report Library file	.TXR

The runtime Print Engine	C60PRNTX.EXE

The Runtime Library file:	C60RUNX.DLL

Any Data Files the report uses.

File Driver(s):	The appropriate File Driver for the format of your data files (one or more from the list below):

Driver	Library

ASCII	C60ASCX.DLL

BASIC	C60BASX.DLL

Btrieve	C60BTRX.DLL

Clarion	C60CLAX.DLL

Clipper	C60CLPX.DLL

dBase III	C60DB3X.DLL

dBase IV	C60DB4X.DLL

DOS	C60DOSX.DLL

FoxPro	C60FOXX.DLL

ODBC	C60ODBX.DLL

TopSpeed	C60TPSX.DLL

Install the Print engine and the supporting files in a single directory. The Report Library and data files can be in the same directory or any other directory. You can also use search paths to "point" the library to the location of the data files.

Optionally, you can set up Program Manager Icons or Shortcuts to run individual reports.


Importing File definitions from a Multiple Table .TPS File

TopSpeed Database files can store multiple tables in a single file.

The data files share a single DOS file handle, opened when the first file is opened, and closed when the last file is closed.

This feature is especially useful when there are a large number of small tables, or when the application must normally access group of related files together.

To import a TopSpeed File:

1.	Choose File [image] Import [image] TopSpeed File.

The Open TopSpeed File window appears.

2.	Press the ellipsis (…) button next to the Filename entry box.

A standard file open dialog appears.

3.	Select the file from the standard file open dialog, then press the OK button (if necessary, "walk" the directory tree to the appropriate subdirectory).

If the file contains multiple tables, the Tables for ... dialog appears.

4.	Highlight a table, then press the Select button.

5.	Press the OK button on the Open TopSpeed File window.

The file definition is imported and is available for your report.

6.	Repeat the these steps for each table in the database.


Report-Specific Fields

Runtime fields, Totals, Computed, and Conditional fields are report-specific—fields used only by one report. Report-specific fields can be used alone or in combination with other fields in a formula. There are four types of report-specific fields:

Total Field:	Calculates a sum, average, count, minimum, or maximum on a specified data field and assigns that value to the total field.

Computed Field:	Performs a specified calculation on data and assigns the result to the field.

Conditional Field:	Evaluates an expression and assigns one value to the field if the expression is true and another if the expression is false.

Runtime Field:	Accepts input from the user at runtime, then assigns the value to the runtime field.


Using Total Fields

There are five types of "total" fields: Sum, Average, Count, Max, and Min.

A Sum field keeps a running total of the field selected as the Use Field.

An Average field totals the Use Field and divides that sum by the number of fields processed, resulting in the arithmetic mean (average value) of that field.

A Count field tallies the number of times the Use Field is printed.

A Min or Max field evaluates and stores the minimum or maximum values of the Use Field, respectively.

There are two methods to create a Total Field—the Total Wizard and the Standard Method.


Creating Total Fields (Total Wizard)

1.	Choose Control [image]  Field Total (or press the  button on the Control toolbox).

The Field Total Wizard appears. This wizard lets you specify the field on which to total, the total type and how it is tallied and reset.

2.	Select the field to total from the list on the left. If necessary, change the file by selecting a different one from the drop-down list.

3.	Select the total Type from the drop-down list (Sum, Average, Count, Max, or Min).

4.	Type the picture for the field in the Picture field, or press the ellipsis (...) button to use the Picture Editor.

This specifies how the total field's value displays.

5.	Select the Tally On choice from the drop-down list.

The choices are PAGE, ALL, or any Group Breaks defined in the report. If you choose PAGE, the total computes every time page overflow occurs. If you choose ALL, the total computes every time the Detail Band prints. If you choose a Group Break, the total computes every time the group break occurs.

6.	Select the Reset On choice from the drop-down list.

The choices are PAGE, NONE, and any Group Breaks defined in the report. If you choose PAGE, the total resets every time page overflow occurs. If you choose NONE, the total resets only when the report is completed. If you choose a Group Break, the total resets every time the value of the group break field changes.

NOTE:	Your Tally On and Reset On choices should never be the same. If they are the same, you have told ReportWriter to tally and reset the total at the same time—the total will always be zero.

7.	Press the OK button.

8.	CLICK on the Report at the location where you want the total field.


Creating Total Fields (Standard Method)

1.	Choose Report [image]  File Schematic (or press the  button on the toolbar).

The File Schematic window appears. The File Schematic lists all of the report's files, the fields in those files, and the report-specific fields.

2.	Highlight Total Fields in the File Schematic, then press the Add Total Field button.

The Total Field window appears. This is where you define the total field.

3.	Type a name for the field in the Label field.

The Label can contain only alphanumeric characters (letters or numbers) or the underscore ( _ ) character, and must begin with a letter. Spaces are not allowed. The maximum length is 40 characters. Each field name must be unique. There can be no duplicate names within a report.

4.	Optionally, provide a Description.

A description can help you identify the total field.

5.	Type the picture for the field in the Picture field, or press the ellipsis (...) button to use the Picture Editor.

This specifies how the total field's value displays.

6.	Select the Field to Total by pressing the ellipsis (...) button.

The Field Selection window appears. Highlight the field on which to base the calculation, then press the Select button.

7.	Select the Tally On choice from the drop-down list box.

The choices are PAGE, ALL, or any Group Breaks defined in the report. If you choose PAGE, the total computes every time page overflow occurs. If you choose ALL, the total computes every time the Detail Band prints. If you choose a Group Break, the total computes every time the group break occurs.

8.	Select the Reset On choice from the drop-down list box.

The choices are PAGE, NONE, and any Group Breaks defined in the report. If you choose PAGE, the total resets every time page overflow occurs. If you choose NONE, the total resets only when the report is completed. If you choose a Group Break, the total resets every time the value of the group break field changes.

NOTE:	Your Tally On and Reset On choices should never be the same. If they are the same, you have told ReportWriter to tally and reset the total at the same time—the total will always be zero.

9.	Select the total Type from the drop-down list (Sum, Average, Count, Max, or Min).

10.	Press the OK button.

The total field appears in the file schematic and you can place it on the report.

11.	Press the Close button to exit the File Schematic.

•	To place a Total field on a report:

1.	Choose Control [image]  Data Field.

The File Schematic window appears.

2.	Highlight Total Fields in the File Schematic.

3.	Highlight the Total Field in the Fields List, then press the Select button.

4.	CLICK on the report at the location to place the field.


Using Computed Fields

A computed field is a field whose value is determined by the result of an expression. This is similar to an assignment statement in most programming languages. The computed field is assigned the value from the expression.

Expressions can range from the very simple to very complex. For example a computed field to return today's date uses the formula:

TODAY()

For a computed field to calculate the tax for an invoice, one possible formula might be

SubTotal * TaxRate.

All of these expressions are created in the Formula Editor, which produces the correct syntax for the expression.

•	To create a Computed Field:

1.	Choose Report [image]  File Schematic (or press the  button on the toolbar).

The File Schematic window appears. The File Schematic lists all of the report's files, the fields in those files, and the report-specific fields.

2.	Highlight Computed Fields in the File Schematic, then press the Add Computed Field button.

The Computed Field window appears. This is where you define the computed field.

3.	Type a name for the field in the Label field.

The Label can contain only alphanumeric characters (letters or numbers) or the underscore ( _ ) character, and must begin with a letter. Blank spaces are not allowed. The maximum length is 40 characters. Each field name must be unique. There can be no duplicate names within a report.

4.	Optionally, provide a Description.

A description can help you identify the Computed field.

5.	Type the picture for the field in the Picture field, or press the ellipsis (...) button to use the Picture Editor.

This specifies how the total field's value displays. .

6.	Type a Formula in the entry box, or press the Formula button to use the Formula Editor.

The Formula Editor appears. This lets you create a syntactically correct expression. In the Formula Editor, you add components one-by-one from a list of the available components. The Formula Editor offers only valid options every step of the way.

7.	Create an expression with the Formula Editor.

8.	Press the OK button.

•	To place a Computed Field on a report:

1.	Choose Control [image]  Data Field.

The File Schematic window appears.

2.	Highlight Computed Fields in the File Schematic.

3.	Highlight the Computed Field in the Fields List, then press the Select button.

4.	CLICK on the report at the location where the field is to be placed.


Using Conditional Fields

A conditional field is assigned one of two possible values: one if the condition is true; the other if the condition is false. To create a conditional field, first determine the condition to evaluate, then determine the values to assign to the field when the condition is true and when it is false.

ReportWriter uses a simple IF structure to assign one of two values to the Conditional field depending on the condition. For example, you may want to determine the tax for an order. The tax depends on a condition—is the customer taxable or non-taxable? The resulting control structure would be:

IF CUS:Taxable	! conditional expression

  TAX = ORD:Total * CUS:TaxRate	! True assignment expression

ELSE

  TAX = 0	! False assignment expression

END

The Conditional Field is defined as shown in the illustration below.

•	To create a Conditional Field:

1.	Choose Report [image]  File Schematic (or press the  button on the toolbar).

The File Schematic window appears. The File Schematic lists all of the report's files, the fields in those files, and the report-specific fields.

2.	Highlight Conditional Fields in the File Schematic, then press the Add Conditional Field button.

The Conditional Field window appears. This is where the field is defined.

3.	Type a name for the field in the Label field.

The Label can contain only alphanumeric characters (letters or numbers) or the underscore ( _ ) character, and must begin with a letter. Blank spaces are not allowed. The maximum length is 40 characters. Each field name must be unique. There can be no duplication of names within a report.

4.	Optionally, provide a Description.

A description can help you identify the Conditional field.

5.	Type the picture for the field in the Picture field, or press the ellipsis (...) button to use the Picture Editor.

This specifies how the total field's value displays.

6.	Type an expression for the If Condition, or press the Formula button to use the Formula Editor.

The Formula Editor lets you create a syntactically correct expression. In the Formula Editor, you add components one-by-one from a list of the available components. The Formula Editor offers only valid options every step of the way.

Since a Conditional Field evaluates the truth of a statement, the Formula Editor creates a Conditional expression. A conditional expression evaluates as true or false. For example, the expression: Date < 06/07/1996 evaluates as true if the value of the Date field is 06/06/1996 or less. If it is greater than or equal to 06/07/1996, then the expression evaluates as false.

7.	Type an expression for the Then Condition, or press the Formula button to use the Formula Editor.

The Then expression's value is assigned to the field when the If condition is true.

8.	Type an expression for the Else Condition, or press the Formula button to use the Formula Editor.

The Else expression's value is assigned to the field when the If condition is not true.

•	To place a Conditional Field on a report:

1.	Choose Control [image]  Data Field.

The File Schematic window appears.

2.	Highlight Conditional Fields in the File Schematic.

3.	Highlight the Conditional Field in the Fields List, then press the Select button.

4.	CLICK on the report at the location to place the field.


Creating a Runtime Field

Runtime fields have many uses. When a report has a runtime field, users receive a prompt asking for input when they run the report.

The runtime field can be a component in the expressions used by detail filters, record filters, computed fields, or conditional fields. A runtime field can also be printed on a report.

•	To create a runtime field:

1.	Choose Report [image]  File Schematic (or press the  button on the toolbar).

The File Schematic window appears. The File Schematic lists all of the report's files, the fields in those files, and the report-specific fields.

2.	Highlight Runtime in the File Schematic, then press the Add Runtime Field button.

The Runtime Field window appears.

3.	Type a name for the field in the Label field.

The Label can contain only alphanumeric characters (letters or numbers) or the underscore ( _ ) character, and must begin with a letter. Blank spaces are not allowed. The maximum length is 40 characters. Each field name must be unique. There can be no duplicate names within a report.

4.	Optionally, provide a Description.

A description can help you identify the Runtime field.

5.	Type the picture for the field in the Picture field, or press the ellipsis (...) button to use the Picture Editor.

This specifies how the runtime field's value displays or prints. This also limits the number of characters the user can type in at runtime.

6.	Type the message that asks the user for data into User Prompt field.

This is what the user sees in the window that appears before the report runs. All characters are allowed, including spaces, but the maximum is 20 characters.

7.	If you want to provide a default value, type it in the Default Value field.

When the user runs a report, this value is provided in the entry field for the variable. The user can accept this value by pressing the OK button, or can provide a new value by typing it in.

8.	If you want Validity checking for the Runtime Field, press the Validation Formula button to create the expression with the Formula Editor .

Validity Checking establishes constraints for data entry. This ensures that only valid data is in a runtime field. For example, you may want a value to be greater than ten (10). Creating this Validity Check prevents users from entering a value less than ten at runtime.

9.	When you use Validation, optionally provide an Error Message.

This is the message a user sees when entering invalid data in the runtime field.

10.	Press the OK button.