Methods

set_alias()

set_alias(string $str) : void

Set an alias for this report.

The alias can be used for locating stylesheets or other files unique to this report.

Parameters

string $str

get_alias()

get_alias() : string

Get this object's alias If not explicitly specified, an alias will be automatically generated.

Returns

string

add_stylesheet()

add_stylesheet(string $filename)

Add a stylesheet to the output.

Multiple stylesheets are permitted. By default, the get_head_contents() method will read this list and generate stylesheet links.

Parameters

string $filename

The complete filename to the css file. Must be relative to the website root url or uploads url.

generate()

generate() : void

Generate the report output.

get_output()

get_output() : mixed

Get the generated output.

This method may return textual data suitable for echoing/displaying. Or it it may generate a static file and return nothing.

Returns

mixed

do_header()

do_header() : string

An abstract function that is called o output HTML before the end of the document.

does not include the ending body or html tags.

Returns

string

do_footer()

do_footer() : string

An abstract function that is called o output HTML before the end of the document.

does not include the ending body or html tags.

Returns

string

do_head()

do_head() : string

An abstract function that is called to output the head (and beginning body tag) of the HTML report.

Returns

string

get_head_contents()

get_head_contents() : string

Geerate tags (such as stylesheet tags) that are required for the HEAD portion of the HTML output.

Returns

string —

The HTML tags to go into the HEAD portion.

before_line()

before_line() : void

A callback function that is called before each and every line.

after_line()

after_line() : void

A callback function that is called after each and every line.

before_group_footers()

before_group_footers() : void

A callback function that is called before the start of outputing group footers.

after_group_footers()

after_group_footers() : void

A callback function that is called after the outputing group footers.

before_group_headers()

before_group_headers() : void

A callback function that is called before the outputing group headers.

after_group_headers()

after_group_headers() : void

A callback function that is called after the outputing group headers.

draw_cell()

draw_cell(\CGExtensions\reports\tabular_report_cellfmt $cell, string $contents)

A callback function to draw a cell.

Parameters

\CGExtensions\reports\tabular_report_cellfmt $cell
string $contents

the cell contents.

get_cell_contents()

get_cell_contents(string $col_key, string $tpl, array $row) : string

A function to get cell contents for the specified column of the current row.

Parameters

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)

Returns

string —

The formatted cell contents.

get_group_cell_contents()

get_group_cell_contents(string $col_key, string $grp_key, string $tpl, array $row) : string

A function to get cell contents for a group header or footer cell.

Parameters

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.

Returns

string —

The formatted cell contents.

before_row()

before_row() : void

A callback function called before each row.

after_row()

after_row() : void

A callback function called after each row.

changed()

changed(\CGExtensions\reports\tabular_report_defn_group $grp, array $row) : bool

Test if the value for a specified group has changed.

Parameters

\CGExtensions\reports\tabular_report_defn_group $grp

The group that references the watched column.

array $row

The data row.

Returns

bool

before_group_header()

before_group_header(\CGExtensions\reports\tabular_report_defn_group $grp, bool $is_first) : void

A callback function that is called before a single group header is output.

Parameters

\CGExtensions\reports\tabular_report_defn_group $grp
bool $is_first

True if this is the first of all group headers (subject to change)

after_group_header()

after_group_header(\CGExtensions\reports\tabular_report_defn_group $grp) : void

A callback function that is called after a single group header is output.

Parameters

\CGExtensions\reports\tabular_report_defn_group $grp

before_group_footer()

before_group_footer(\CGExtensions\reports\tabular_report_defn_group $grp) : void

A callback function that is called before a single group footer is generated.

Parameters

\CGExtensions\reports\tabular_report_defn_group $grp

after_group_footer()

after_group_footer(\CGExtensions\reports\tabular_report_defn_group $grp) : void

A callback function that is called after a single group footer is generated.

Parameters

\CGExtensions\reports\tabular_report_defn_group $grp

start()

start() : void

A callback function when the report is started.

finish()

finish() : void

A callback function for when the report is finished.

each_row()

each_row(array $row)

A callback functon for each data row.

Parameters

array $row

The row returned from the query.