User Tools

Site Tools

Navigation:  Templates > Templates by Topic > Report >====== Procedure Properties - Report ====== Previous pageReturn to chapter overviewNext page

This template procedure is used to create reports. Press the Report button in the Procedure Properties dialog to create your report. The procedure template includes a window to show the progress of the report processing. The Report Properties dialog includes an option to specify whether you want to generate a print preview window for your report.

Procedure Name The Procedure Name is displayed here. Press the ellipsis button to change the name if desired. You will be prompted for a New Procedure Name, and the ability to Accept or Discard your changes.
Template The base template type used by this procedure is displayed here. You can change the template type by pressing the ellipsis button to the right. The Select Procedure Type dialog is displayed for a new selection if needed.
Description A text description for the procedure, which appears next to the procedure name in the Application Tree dialog.Press the ellipsis ( … ) button to edit a longer (up to 1000 characters) description.
Category A category is used to help you group procedures together when the Category Tree view is active.
Module Name The disk file name for the code in the procedure. Select from the dropdown list. By default, the Application Generator names modules by taking the first five characters of the .APP file name, then adding a three digit number for each module.
Prototype Allows you to optionally type a custom procedure prototype which the Application Generator places in the MAP section.
Parameters Allows you to optionally enter any parameter names (a list of variables separated by a comma)
Declare Globally Check this box to generate the procedure's prototype into the PROGRAM's MAP, rather than the MODULE's MAP. This makes the procedure callable from any other procedure, but it also forces a recompile of all program modules whenever you change the prototype.
Export Procedure Declares the procedure in the export file, enabling it to be called by another application. Note: This checkbox is only available when the target file specified in Application Properties is a Dynamic Link Library (.DLL).
Actions This button accesses the Actions dialog for the procedure and its control templates.Control templates provide “pre-assembled” controls, such as list boxes, along with the code to make them  fully functional. This allows you to start with a “bare” procedure template, such as the generic window, and add controls to create your own browse or form windows.
Window Calls the Window Designer, to visually design the window. Press the ellipsis button to access the Window Editor.
Report Calls the Report Designer, to visually design the window. Press the ellipsis button to access the Report Editor.
In the Actions dialog:
Parameters Lets you specify parameter names (an optional list of variables separated by commas, with the entire list surrounded by parentheses) for your procedure, which you can pass to it from a calling procedure. You must specify the functionality for the parameters in embedded source code. See Also: PROCEDURE Calls .
Return Value For functions, lets you specify the variable receiving the return value.
Report Behavior Press this button to control the behavior of the Window. See Window Behavior
ListBox Styles Press this button to maintain any List Box Styles used by this procedure. See List Box Styles.
BIND Fields and Procedures Press this button to maintain all BINDed variables and procedures used in this procedure. See BIND Fields and Procedures.
Window Message The default text to display in the Progress window after opening.
Report Properties Press this button to control all report properties provided by the templates. See Report Properties.

Pressing the Actions button presents this dialog


Report Properties

General tab

Print Preview Check this box to enable previewing of a report before printing. When checked the Preview Options tab will become available.
Data Source Your report can read data to be processed from a target data file (or table), a queue, or from memory.
If you select File from the drop list, options for Quick Scan, Record Filter, Additional Sort Fields, Record Count Override, and Progress Bar Limits are available (and discussed below).
If you select Queue from the Data Source drop list, a Queue Name entry is displayed. Press the E button to the right of the Queue Name prompt to select a target queue that the report will read from. The report reads the queue in record sequence, so it will be important to make sure that the queue is built and sorted properly prior to printing.
Finally, if you select Memory from the Data Source drop list, the report will not process (e.g., loop through) the report file designated in the report procedure's Table Schematic. Essentially, this setting is used to print a “snapshot” of the populated report elements and their values when the print process is called.


If you select Memory or Queue as your data source, you will still have to designate a primary table in the Table Schematic dialog. This table, however, will not be processed when these alternative data sources are selected.

MDI Progress Window Check this box to specify that the Progress Window generated for this report will be MDI. This option is necessary if you plan to allow multiple reports to run on different threads at the same time.  Do not check this box if your report procedure is not threaded.
Progress Interval Timer Enter a value in hundredths of a second that specifies the timer interval for this report. The lower the number, the progress update will show a smoother display during report generation. The larger the interval, the less frequent the progress window will be refreshed. Use this setting when you plan to run multiple reports at the same time, and need to fine tune the intervals between report procedures.
Quick-Scan Records Specifies buffered access behavior for ODBC, ASCII, DOS, or BASIC files. These file drivers read a buffer at a time (not a record), allowing for fast access. In a multi-user environment these buffers are not 100% trustworthy for subsequent access, because another user may change the file between accesses. As a safeguard, the driver rereads the buffers before each record access. To disable the reread, enable QUICKSCAN.
Record Filter Type an expression to limit the contents of the browse list to only those records which match the filter expression. Press the E button to call the Expression Editor, to help you construct syntactically correct expressions.
This filters all displayable records. When a Record filter is used in conjunction with a Range Limit, only those records within the specified range are filtered. See Also: Using Range Limits and Filters
Additional Sort Fields Type a comma delimited list of fields on which to sort. These sort fields are in addition to the key for the report set in the Data / Tables Pad. If no key is specified, this is the sort order used allowing you to sort records without a key.
IPDRV Options If you are using the IP Driver in your application, press this button to access the IPDRV Options dialog.
Record Count Override Specify an approximate record count if the report is filtered. The progress indicator uses this value to calculate the percent completed value.
Set progress bar limits manually? Clear this box to make your procedure read the result set and set the progress bar limits automatically. Setting limits automatically may produce poor performance for some SQL data sets, or erratic or inaccurate progress indicator for unevenly distributed result sets. Check this box to manually provide progress bar limits for the procedure. Setting manual limits can provide faster performance for SQL drivers and more accurate progress indicators for unevenly distributed result sets. This setting is only effective if you specify a Key for the File in the Data / Tables Pad.
Low Progress Bar Limit Supply the lowest “free” key element value for the result set. You may type the value or the label of a variable containing the value. Enclose literal string values in single quotes ('value').
High Progress Bar Limit Supply the highest “free” key element value for the result set. You may type the value or the label of a variable containing the value. Enclose literal string values in single quotes ('value').


Report Targets

This tab control and its options are only visible if you have the Advanced Report Generation templates enabled. The options here allow you to designate a default report target and method to use with these supported templates.



If this tab control does not appear after including the Advanced Report Generation Global , Extension, make sure to regenerate your application.

Report Target From the drop list, select the initial output the report is to be directed to. If you select Printer, the report defaults to a standard printed output. Selecting Other enables the Other Target prompt, where you can select a different output type by default. Select Ask at Runtime to allow a popup window to display before the report begins to process. The window displayed at runtime would look something like this:

reportoutput.jpg This is the runtime window that allows selection of a report target type.

Add Printer as an option This option is only available if you have selected Ask as Runtime as the report target. Check this box to include direct printer output as a user choice at runtime.
Other target This drop list is only available if you select Other as your Report Target option. Select from HTML, PDF, TXT or XML as your default report target.


If you have more than one “Report To” template set active, you can always change the default target at runtime in the Print Preview window. Simply select File > Save As from the menu, and a list of valid report outputs will be displayed for selection.

Open report output after generated

If this option is checked then after the Report outputs to the designated target (PDF, HTML, etc.) the Shellexecute API is called andpassed the name of the generated report target.  This launches the program the end-user has associated with the file type to open the report.  For example, Adobe Reader may be associated with .PDF files and would be used to open the report output (PDF).
Hidden Controls Each Advanced Report Generation template has the option to hide controls that are not applicable to its output. The idea is to have special controls populated on your report for different types of outputs. For example, you may have a field on a report that stores the proper tag information for a PDF document, and in the same area a hot link tag for HTML. In the Report to HTML template, you can hide the PDF Bookmark field, and in the Report to PDF template, hide the HTML specific control.The Hidden Controls button displays a list box of ALL controls hidden for all available formats that you have enabled. This allows you to quickly search for a control that needs your attention.

Range Limits

Range Limit Field In conjunction with the Range Limit Type, specifies a record or group of records for inclusion in the report. Choose a field by pressing the ellipsis (…) button. The Range Limit Field must be a component of the report's Access Key. The range limit is key-dependent; the generated source code uses the SET statement to find the first valid record.
Range Limit Type Specifies the type of range limit to apply. Choose one of the following from the drop-down list.
Current Value signifies the current value of the Range Limit Field.
Single Value lets you limit the list to a single value. Specify the variable containing that value in the Range Limit Value box which appears.
Range of Values lets you specify upper and lower limits. Specify the variable containing the values in the Low Limit and High Limit Value boxes.
File Relationship lets you choose a range limiting file from a 1:MANY relationship. This limits the report to display only those child records matching the current record in the Parent file. For example, if your report is a list of Orders, you could limit the output to only those orders for the current Customer (in the Customer file).
See Also: Using Range Limits and Filters

Preview Options

The Preview Options tab lets you control the initial appearance of the report preview window. This tab is only available if you check the Print Preview box on the General tab.


Although nearly all font types used on reports will print accurately, for the best display of reports in the Print preview window, use a True Type font (Example ' Arial 10pt).

Runtime Skip Preview Press the E button to select a variable or expression that the template will use to determine whether or not a Print Preview window will be displayed prior to printing the report. A TRUE (or non-zero) value will cause the Print Preview to be skipped. A value of zero (or FALSE, the template default) will enable the Print Preview window.
Override Global Report Preview Procedure (Clarion templates only) Check this box if you would like to create a special print preview procedure to use for this report only. In the Report Preview Procedure drop list select an existing procedure, or enter a new name.

The following Preview Options prompts apply to the ABC templates only:

Initial Zoom Setting Sets the initial magnification for the report to one of seven discrete magnification choices. The end user may change the initial setting at runtime.
Allow User Variable Zooms? Check this box to let the end user set custom report magnifications in addition to the preset magnification choices.
Set Initial Window Position Check this box to enable the four following prompts to set the initial preview window position and size.
X Position The initial horizontal position of the left edge of the window.
Y Position The initial vertical position of the top edge of the window.
Width The initial width of the window.
Height The initial height of the window.
Maximize Preview Window Check this box to initially maximize the preview window. This supersedes the Set Initial Window Position, whose coordinates are applied only when the window is restored to its normal unmaximized state.
MDI Preview Window Check this box to specify that the Preview Window generated for this report will be MDI. This option is necessary if you plan to allow multiple reports to run on different threads at the same time. The disadvantage to this could be a slight reduction in report generation performance. DO NOT check this box if your report procedure is not threaded.


The Breaks tab provides support for adding embedded break logic that is not associated with any bands or break structures on the report. The two uses for this type of logic are used in totaling and conditional headers and footers. The breaks defined here are solely based on field (column) values, and are not associated with any particular band (as in the traditional breaks).

Press the INSERT button to add a new break. You can also change or delete an existing break, or change the break order by using the appropriate move up/move down buttons.


Each break that is created generates embed points that the developer can use to initialize (Take Start), analyze (Update Total), and reset (Take End) each program break. These embeds are provided by the Break Manager Class, which is the internal logic that supports the template interface. Press the Embeds button, and search for Break Manager to locate these embed points.

In the Break dialog window, the following prompts are provided:


Name: Enter a descriptive name for the embedded break that you are creating.
New Break Level 0? Embedded breaks can be nested. For example, one break can be a totaling break whose result is used in a second totaling break. Check this box if the break will not be dependent on another break.
Fields Fields are the elements that trigger break logic. Each time the field contents changes, and embedded break is triggered. Additional fields may be added, and any field whose contents changes will generate the break.
Totaling Each time that an embedded break is generated, a total result may be calculated. Press the Insert button to create a total field that will be calculated when the break is triggered.
Target Field Press the ellipsis button to select a target field that will hold the totaling result.
Type From the drop list, select Count, Sum, Average, SumPro or Weighted Average to determine the type of totaling that need to be performed on the break.
Source Field Press the ellipsis button to select a source field that will be used as the totaling value.
Source Field (Weight) Press the ellipsis button to select a source field that will be used as the additional element in the SumPro or Weighted Average value as follows:
SumPro += (Source Field * Source Field (Weight))
Weighted Average = SumPro(Source Field * Source Field (Weight))/Sum(Source Field (Weight))
Do Total On Specify that the total will be calculated on All Records, or a Condition that is specified below.
Condition If your Do Total On choice is based on Condition, enter an expression here that will only include the Source Field value if the condition evaluates to “TRUE”.
Reset on Break? Check this box to reset the Target Field after the break has been generated.

Header and Footer

An embedded break can be used to generate a conditional header or footer on a page. An example of this might be a multi-page invoice, where the header of the first page may differ from the header of the second page. In this case, you can create an extra detail section that is used as your “Page Two”, and triggers on a page number embedded break.

Print Header? Check this box if you would like to generate a header detail when an embedded break is detected. Select a detail band to use for the generated Header.
Print Footer? Check this box if you would like to generate a footer detail when an embedded break is detected. Select a detail band to use for the generated Footer.

Hot Fields

You must BIND any variables or EQUATEs used in a filter expression. Press Insert to add the variable to the Hot Fields list, and check the Bind Field box.

For the use of Hot Fields with embedded breaks, check the Restore Field on Break check box. This will store a copy of the hot field value of the previous record read. When an embedded break is detected, the previous record value is restored for printing.

Detail Filters

Each Detail band is listed in the Detail Filters list. To restrict printing of a band, highlight it in the list, then press the Properties button. Provide an expression in the Filter field. The band will only print when this expression is true. Press the E button to call the Expression Editor. This dialog is used to help you construct syntactically correct expressions to use in the prompt.

Optionally, check the Exclude unfiltered box to restrict any other detail band which does not have a filter expression of its own.

The Additional Filters display will show any filters that are generated by other report support templates (like the ReportChild Extension).

Classes Tab

Use the Classes tab to override the global settings for the Class. See Classes Tab.

tplprocreport.htm.txt · Last modified: 2021/04/15 15:57 (external edit)