REPORT Object
- Last UpdatedMar 28, 2023
- 3 minute read
The report object is used to format the table object data for displaying the contents of a table to the screen, forms or to file. Separating the formatting and extraction of the data from a table allows different reports to be generated from the same basic table.
The report extracts the data from a TABLE and formats each of the columns according to the associated COLUMNFORMAT object. You may optionally specify that only rows which contain a specified MATCH string (which may or may not be case-dependent) should be included it the report output.
The results may be extracted:
-
All at once, using the Results() methods.
-
A specified number of entries at a time, using the NextEntries()methods. Each entry will consist of one or more lines.
-
A specified number of lines at a time, using the NextLines()methods. This may cause a partial entry to be returned at the end, but the next call to nextLines will fetch the remainder of the entry.
The first ARRAY argument provided to these methods will contain a set of STRINGs, each of which holds a Dtext row of data. If there is a second array argument, then this will contain the corresponding Rtext, which will be the name of the DBREF object associated with that row. For multi-line entries, the same Rtext value will be provided for each line.
Methods
|
Name |
Result |
Purpose |
|---|---|---|
|
Report() |
Constructor. |
|
|
Report(TABLE) |
Constructor that also sets the table and column formats. |
|
|
Table(TABLE) |
Sets the table to be used for the report. |
|
|
AddColumn(STRING key, COLUMNFORMAT, STRING heading) |
Adds the column with the specified key to the report, with the passed column format. The argument 'heading' is the column heading. |
|
|
NextEntriesIndex(REAL position) |
Sets the position in the result array to be used for the next evaluation. |
|
|
NextEntriesIndex(REAL n, STRING) |
Sets the position in the matched result array to be used for the next evaluation. |
|
|
SetCaseMatch(BOOLEAN) |
Used in conjunction with the '...MATCH' methods, defines whether matching is case sensitive. |
|
|
Initialise() |
Re-initializes the next counter. |
|
|
EvaluateTable() |
Re-evaluates on the table primary key and re-sorts. |
|
|
Keys() |
STRING ARRAY |
Returns an ARRAY of STRINGS that are the column keys used on this report. |
|
ColumnFormat(STRING key) |
COLUMN FORMAT |
Returns the column format of the passed column key. |
|
ColumnHeading (STRING key) |
STRING |
Returns the heading of the column identified by key. |
|
Table() |
TABLE |
Returns the table used in this report. |
|
CaseMatch() |
BOOLEAN |
Queries whether the MATCH STRING is case sensitive. Set using CaseMatch (BOOLEAN). |
|
Results(ARRAY Dtext, ARRAY Rtext) |
BOOLEAN |
Evaluates the report using all entries of the table (there may be more than 1 line per entry. If column formats cause a wrap-around Rtext will be repeated). The return is TRUE if there are entries to evaluate, FALSE if there are no entries. Both Rtext and Dtext must exist; they will be updated with the values. |
|
Results(ARRAY) |
BOOLEAN |
As above but only Dtext is evaluated. |
|
ResultsMatch(STRING, ARRAY, ARRAY) |
BOOLEAN |
Similar to Results() but only values matching the string are put into the two arrays. |
|
ResultsMatch(STRING, ARRAY) |
BOOLEAN |
As above but only Dtext is evaluated. |
|
NextEntries(REAL n, ARRAY Dtext, ARRAY Rtext) |
BOOLEAN |
Evaluates the report using the next n entries of the table (there may be more than 1 line per entry, if column formats cause a wrap-around the Rtext will be repeated). The return is TRUE if there are entries to evaluate, FALSE if there are no entries. Both Rtext and Dtext must exist; they will be updated with the next n values. |
|
NextEntries(REAL n, ARRAY) |
BOOLEAN |
As above but only Dtext is evaluated. |
|
NextLines(REAL n, ARRAY Dtext, ARRAY Rtext) |
BOOLEAN |
Evaluates the report with the next n lines of the table, if column formats cause a wrap-around the Rtext will be repeated. The return is BOOLEAN to indicate if there are lines to evaluate. Both Rtext and Dtext must exist; they will be updated with the next n values. |
|
NextLines(REAL n, ARRAY) |
BOOLEAN |
As above, but only Dtext is evaluated. |
|
NextEntriesMatch (REAL n, STRING value, ARRAY Dtext, ARRAY Rtext) |
BOOLEAN |
Similar to NextEntries() but only values matching value are put into the two arrays. |
|
NextEntriesMatch(REAL n, STRING value, ARRAY Dtext) |
BOOLEAN |
As above but only Dtext is evaluated. |
|
NextEntriesIndex() |
REAL |
Returns the current position in the array of entries. |
|
NextLinesIndex() |
REAL |
Returns the current position in the array of entries. |
|
NextEntriesIndex (STRING) |
REAL |
Returns the current count of the matched values array. STRING is a key word 'MATCH'. |