SATREPORT Reference |
Layout of SATREPORT Applications |
The base directory for a SAT application must be defined in an exported environment variable called SATHOME. Under this directory the following directories must exist:-
$SATHOME |
report |
Report definition files. |
This directory contains the report definitions.
Usage |
Syntax: | satreport ?-r|raw? report |
---|---|
?-r|raw?: | Output "Raw" data, not processed by SATFILTER. |
report: | Name of report file in $SATHOME/report directory |
Example: | satmysql employee |
SATREPORT reads TAB delimited columns of data from standard input. By default the first row will be considered "column names", using the names=no option causes SATREPORT to see the first row as data, in which case all rows are considered to be data and the "column names" will numbered from 1 to column-count.
SATREPORT reads the variable data from standard input in the following format:
column-name1\tcolumn-name2\tcolumn-name3
data1-item1\tdata1-item2\tdata1-item3
data2-item1\tdata2-item2\tdata2-item3
data3-item1\tdata3-item2\tdata3-item3
...
...
...where \t represents a TAB character.
The column-names must not contain spaces. Although upper and lower case characters may be used, it is recommended that lower case only be used for column names, as upper case is used to identify predefined data items.
Variable Data |
As described above, SATREPORT reads variable data from standard input. By default the first row will be read as "column names". Within a SATREPORT variable data is refered to by these names. The variable data may also, optionally, have its case converted in one of three ways.
Examples:
Assume the value of the column data item name is "john SMITH"
Data Item | Replaced with | Conversion |
${name} | john SMITH | None |
%{name} | John Smith | Mixed case |
+{name} | JOHN SMITH | Upper case |
-{name} | john smith | Lower case |
Predefined Data |
Data Item | Value |
COUNT | Cumulative count of data rows. |
DATE | Current date in format defined by dateformat. |
GROUP | Name of current Group. |
GROUP-COUNT | Cumulative count of data rows for current Group. |
GROUP-PAGE | Number of page in current Group. |
GROUP-SUM-column | Cumulative sum of column for current Group. |
PAGE | Number of page. |
SUM-column | Cumulative sum of column. |
Example:
Assume todays date is 23rd March 2001 and the dateformat is the default (us):
Data Item | Replaced with |
${DATE} | 03/23/2001 |
Groups |
The SATREPORT has a facility which allows reports to be subdivided in groups.
When grouping is enabled (group=yes), the first column of the input data is used for grouping. The input data must be sorted on the first column.
SATREPORT Definition Layout |
SATREPORT definitions must have the following general layout:
<config> dateformat=eu|gb|us|text layout=landscape|portrait length=nn group=yes|no names=yes|no </config> <front> Front page definition. </front> <group> <header> Group header definition. </header> <footer> Group footer definition. </footer> </group> <page> <header> Page header definition. </header> <data> Data format definition. </data> <footer> Page footer definition. </footer> </page> <back> Back page definition. </back>All definition sections are optional. Although, in order to produce some output, at least one should be specified!!