report1
Another SIMPOL language type is report1, which is part of the library
called reportlib.sml
. It implements a set of
functions and types to provide a basic reporting engine. The output of the
report1 type is not specified, the output is handled by the calling
program. The Quick Report and Graphic Report packages are both implemented by using the
report1 type. The primary purpose in making the report1 type available
is to allow the creation of custom report types by SIMPOL programmers. For details
about working with the report1 package, visit the section called “Working with report1”.
Type | Description |
---|---|
report1 | The key element of the report system is this type. It is used to define and then run the report. |
report1aggregate | This type is used for defining an aggregate calculation for a group or the entire report. |
report1aggregatevalue | This type is passed to a function that is handling the aggregate. Unless you are implementing your own aggregate calculation, rather than using one of the ones supplied, you will not use this type. |
report1group | Provides the capability of adding one or more groups to a report. Includes events for ongroupstart and ongroupend, to allow the event handler to process the output at the start of the group (group name, etc.) and again at the end (totals). |
report1groupinst | This is the type that is passed to the event handling functions for ongroupstart and ongroupend. |
report1inst | When a report is running, this type is created to contain the data about the currently running instance of the report definition. It is passed to the events of the report1 object. |
The rest of the implementation is mainly the functions that have been
pre-defined for handling the various aggregate types. These consist of:
Function | Description |
---|---|
report1_agg_getval_count() | This is the function that retrieves the value for the COUNT aggregate. |
report1_agg_update_count() | This function is called to update the COUNT aggregate value. |
report1_agg_getval_mean() | This is the function that retrieves the value for the MEAN aggregate. |
report1_agg_update_mean() | This function is called to update the MEAN aggregate value. |
report1_agg_getval_median() | This is the function that retrieves the value for the MEDIAN aggregate. |
report1_agg_update_median() | This function is called to update the MEDIAN aggregate value. |
report1_agg_getval_mode() | This is the function that retrieves the value for the MODE aggregate. |
report1_agg_update_mode() | This function is called to update the MODE aggregate value. |
report1_agg_getval_sum() | This is the function that retrieves the value for the SUM aggregate. |
report1_agg_update_sum() | This function is called to update the SUM aggregate value. |
The report1 type is quite powerful, but unless you want to
implement your own special report mode, you may find the Quick Report and Graphic Report
engines to be more suitable or easily used.