Progress
Results User’s Guide
for UNIX
Determining the Fields Selected for Reports
Use the following shared variables in your Progress procedures to determine the selected fields in the report or export session. These variables also enable your program to access any calculated fields end users define.
These shared variables have the following characteristics:
- The
qbf-rc#
variable represents the number of report columns in use.- The
qbf-rcn[ ]
variable is an array of column names or other information. It contains one element for each report column. The contents of this field vary depending onqbf-rcc[ ]
. Ifqbf-rcc[ ]
begins with e or is blank, then this is the field name. Otherwise, it is a calculated variable name of the formqbf-###
, where###
represents a three-digit number. Also, depending on the value ofqbf-rcc[ ]
, it might have other contents (see the description forqbf-rcc
for details). However, using theENTRY(1,qbf-rcn[ ])
function always returns the column name.- The
qbf-rcc[ ]
value is an array used for calculated fields and stacked arrays. (Stacked arrays display the information in a vertical format.) If the first character is blank, this is not a calculated field or a stacked array.Table 10–3 describes the calculated field for each symbol.
For calculated field types s, n, l and d,
ENTRY(1,qbf-rcn[ ])
is the column name andSUBSTRING(qbf-rcn,INDEX(qbf-rcn[ ],",") + 1)
contains the expression. You cannot useENTRY(2,...)
to get the expression, since it may have embedded commas.- The
qbf-rca[ ]
value is an array that contains totals information. If it contains just an ampersand (&), the field hides repeating values. Otherwise, it contains a string. If the last character in the string is a dollar sign ($), then it is a totals-only string. The rest of the contents of the field contains a series of one or more pairs of characters, where each pair is a letter followed by a number. The letters can be any of the following:t
,c
,a
,n
, orx
. The digits can be any number from 1 through 6, inclusive. Table 10–4 lists the values that each of these characters represents.
- The
qbf-rcl[ ]
value is an array of column labels. Stacked column labels are supported. In stacked column labels, an exclamation point (!) breaks column labels into more than one level. If there are more than two levels, Results just shows only two levels on the Report Layout screen. However, they generate properly when users run the reports.- The
qbf-rcf[ ]
value is an array of formats for report columns. All Data Dictionary formats are supported. See "Field Display Formats," for information on dictionary formats.- The
qbf-rcw[ ]
value is an array of column widths within the Report module. Use this in conjunction withqbf-r-attr[1]
(left margin) andqbf-r-attr[3]
(between column spacing) to do the report layout. This takes into account format, label widths, and stacked labels.- The
qbf-rct[ ]
value is an array of numbers that corresponds to the data types stored in the shared variableqbf-dtype
. You can use this as an index intoqbf-dtype
to translate to the actual Progress data types for each column in the report. For example, 1 represents character data type, 2 represents date, etc.- The
qbf-dtype
value is a comma-separated list of data types set to “character,date, logical,integer,decimal,raw,recid”. This variable is set by Results, andqbf-rct
is a pointer to one of the types.Use these shared variables to determine the fields users selected in their report or export session, and to access any calculated fields defined in the report.
This is a sample code that lists the subtotal attributes for fields in a report:
![]()
This section searches for attributes using the symbols in Table 10–4 and builds the aggregate expression.
You can use this code as an example when you write your own code. The comments in this code will help guide you.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |