\CGExtensions\reportstext_report_generator

This class will take a report definition and output a text file representation of the report.

Summary

Methods
Properties
Constants
__construct()
generate()
get_output()
set_column_width()
No public properties found
No constants found
before_line()
after_line()
before_group_footers()
after_group_footers()
before_group_headers()
after_group_headers()
draw_cell()
get_cell_contents()
get_group_cell_contents()
before_row()
after_row()
changed()
before_group_header()
after_group_header()
before_group_footer()
after_group_footer()
report()
start()
finish()
each_row()
get_column_width()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

generate()

generate() : void

Generate the report output.

get_output()

get_output() : string

Get the output of the report.

Returns

string —

Output suitable for saving to a text file.

set_column_width()

set_column_width(integer  $val) 

Set the width of each column (in characters)

Parameters

integer $val

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 = null, array  $row = null) : 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 = null) : 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) : boolean

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

boolean

before_group_header()

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.

Parameters

\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()

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.

get_column_width()

get_column_width() : integer

Get the column width (in characters)

Returns

integer