get_output()
get_output() : mixed
Get the output of the report.
Returns
mixed —the actual output format depends upon the template that is provided.
This class generates a report by first generating a series of structured data then passing the entire report output through to a single smarty template.
footers and headers can still be used to gather totals, etc.
__construct(\CGExtensions\reports\report_defn $rpt)
Constructor.
| \CGExtensions\reports\report_defn | $rpt | The report definition. |
set_template(string $tpl)
Set the template to use for formatting the report.
If a string ending with .tpl is provided then a file template for the current module is assumed. Otherwise, a database template for the current module is assumed. If no current module (i.e: the request is not for a module action) can be determined, then The smarty 'file' resource is assumed.
| string | $tpl |
draw_cell(\CGExtensions\reports\tabular_report_cellfmt $cell, string $contents)
A callback function to draw a cell.
| \CGExtensions\reports\tabular_report_cellfmt | $cell | |
| string | $contents | the cell contents. |
get_cell_contents(string $col_key, string $tpl = null, array $row = null) : string
A function to get cell contents for the specified column of the current row.
| string | $col_key | The column key (must be a registered column) |
| string | $tpl | The cell template. |
| array | $row | The current row array (usually used internally) |
The formatted cell contents.
get_group_cell_contents(string $col_key, string $grp_key, string $tpl, array $row = null) : string
A function to get cell contents for a group header or footer cell.
| string | $col_key | The column key (must be a registered column) |
| string | $grp_key | The group key. |
| string | $tpl | The cell template. |
| array | $row | The current resultset row. Only for internal use. |
The formatted cell contents.
changed(\CGExtensions\reports\tabular_report_defn_group $grp, array $row) : boolean
Test if the value for a specified group has changed.
| \CGExtensions\reports\tabular_report_defn_group | $grp | The group that references the watched column. |
| array | $row | The data row. |
before_group_header(\CGExtensions\reports\tabular_report_defn_group $grp, boolean $is_first = FALSE) : void
A callback function that is called before a single group header is output.
| \CGExtensions\reports\tabular_report_defn_group | $grp | |
| boolean | $is_first | True if this is the first of all group headers (subject to change) |
after_group_header(\CGExtensions\reports\tabular_report_defn_group $grp) : void
A callback function that is called after a single group header is output.
| \CGExtensions\reports\tabular_report_defn_group | $grp |
before_group_footer(\CGExtensions\reports\tabular_report_defn_group $grp) : void
A callback function that is called before a single group footer is generated.
| \CGExtensions\reports\tabular_report_defn_group | $grp |
after_group_footer(\CGExtensions\reports\tabular_report_defn_group $grp) : void
A callback function that is called after a single group footer is generated.
| \CGExtensions\reports\tabular_report_defn_group | $grp |
report() : \CGExtensions\reports\report_defn
Get the report definition.