Related Information Examples & Tutorials

How To Use Basic Codes In Reports And Letters

This document explains the basics of using codes in Collect!'s report writer.

Requirements

- Access rights to report definitions and report body forms
- Review help topics on particular report and letter needs

Top of page.

Overview

Whenever you use a report in Collect! or design your own, codes in the report definition tell Collect! what forms and fields to pull information from. They also determine how a report or letter is formatted and what the output looks like.

There are several different "code sets" for different needs in report writing. Special code sets control what and how the report prints.

Top of page.

Printing Codes

1. Printable Fields contain all the fields you can pull information from to print information contained in your database.

2. Printer Control Codes contain all the codes used to control formatting of page and text such as Bold and Double Wide, various sizes of fonts and page setup.

tip.gif Please refer to Report Options for important information about using these codes to format your reports and to set page orientation.

3. Special Functions such as Date, Time, Page Numbers and various other functions can be placed in your reports with codes.

tip.gif When you are in the Report Body, pressing F2 will display the Choose Report Item form. You can automatically place several of these functions in your report by choosing them from this form. Additional formats are available. Refer to Help topic How To Use Date and Time Codes.

4. Variables that you can define yourself can be used for math functions, for addition based on specific conditions and for other purposes. This is an extensive topic. Please refer to How To Use Variables for details.

5. Particular ranges of data can be retrieved with where clauses, if conditionals and prompts. See help topics on these topics.

6. Text files can be included in the printed output - standard
clauses or standard headers and footers that you can include in your reports and letters.

Top of page.

Basic Rules For Using Codes In Report Design

These are basic rules which apply to all code that you use.

@

Codes always start with an @ in report definitions. If this symbol is not present, the report writer does not recognize your code.

//

You can and are encouraged to write clarifying comments in your report designs. Any line beginning with // is ignored by the Collect! report system and will not print out. You can use comments to document certain areas of your design so that modifications can be made at a later date.

Top of page.

Code Syntax

Codes for displaying information from your database contain four parts.

Example: @de.li

1. @ This is described above.

2. The first few characters are an abbreviation for the Collect! FORM that the information comes from.

For example:

de means the Debtor form
cl means the Client form

tip.gif Pull down the Print menu and choose Settings, Printable Information. This will display the list of all Printable Fields that you can pull information from.

3. A period [ . ] separates this set of characters from the next.

4. The second few characters are an abbreviation for a FIELD on the form that is designated by the first set of characters.

For example:

li = Listed Date (when used in @de.li)
na = Name (as in @de.na)

This is the basic code structure used for all commands to pull information from your database. A complete list of codes for all dialogs and their fields is available when you are in the Report Body. Press F2 to view and select code from this list.

PRINTING THE @ SYMBOL

SYNTAX: @@ - This prints the @ symbol in a report.

Example: "mail@@this.net" prints as "mail@this.net"

PRINTING THE % SYMBOL

SYNTAX: %% - This prints the % symbol in a report.

Example: "Earnings of 50%%" prints as "Earnings of 50%"

Top of page.

Using Codes In Control Files

The same syntax is used when writing control files. Refer to How To Use Control Files.

Top of page.

Using Codes Elsewhere In Collect!

In contact plans, events can be scheduled when certain conditions are met. There, also, references to fields from the database follow the same syntax described above. In import routines, and, in fact, anywhere that references are made to fields or field data, this same syntax is used to tell Collect! what field in the database you are referring to.

tip.gif As mentioned above, the syntax for graphics commands in reports is different.

Top of page.

Summary

There are many topics in the Collect! help system to address the aspects of report design and printing.

Top of page.

See Also

- Report Sample to view sample reports and letters
- Report Topics Index for a list of all report and letter topics
- How To Pull Information From Different Fields
- How To Pull Information From Different Forms
- How To Use Control Files
- How To Use Contact Plans

Top of page.

Was this page helpful? Do you have any comments on this document? Can we make it better? If so how may we improve this page.

Please click this link to send us your comments: helpinfo@collect.org