# \CGExtensions\reportsformatted_report_generator

A class to generate a report using a special template for each row or item.

## Summary

Methods
Properties
Constants
__construct()
set_template()
generate()
get_output()
No public properties found
No constants found
get_template()
process_template()
each_row()
report()
start()
finish()
No protected properties found
N/A
No private methods found
No private properties found
N/A

File
  lib/reports/class.formatted_report_generator.php
Class hierarchy
  \CGExtensions\reports\report_generator
  \CGExtensions\reports\formatted_report_generator

## Tags

todo |

## Methods

### __construct()

    __construct(\CGExtensions\reports\report_defn $rpt)

Constructor.

#### Parameters

\CGExtensions\reports\report_defn | $rpt |

#

Inherited from
  \CGExtensions\reports\report_generator

## Tags

todo |

### set_template()

    set_template(string $tpl)

Set the template to be used for formatting the document.

The document template is a smarty template that should at the minimum consist of a {foreach $items as $item}...{/foreach} loop. Each item in the loop will be an HTML string representing each formatted item.

#### Parameters

string | $tpl | The template contents.

#

## Tags

todo |

### generate()

    generate() : void

Generate the report output.

#

Inherited from
  \CGExtensions\reports\report_generator

## Tags

todo |

### 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

#

abstract

Inherited from
  \CGExtensions\reports\report_generator

## Tags

todo |

### get_template()

    get_template() : string

Get the document template.

#### Returns

string

#

## Tags

todo |

### process_template()

    process_template(string $tpl)

Process the specififed template through smarty.

This method will attempt to find the current action module, and given that and the name of the template find the template contents. if the template name ends with .tpl a module file template is assumed. Otherwise, a module database template will be assumed. If a module cannot be determined, then a file template is assumed, using the 'file' smarty resource.

#### Parameters

string | $tpl | The name of the template to process.

#

## Tags

todo |

### each_row()

    each_row(array $row)

A callback functon for each data row.

#### Parameters

array | $row | The row returned from the query.

#

abstract

Inherited from
  \CGExtensions\reports\report_generator

## Tags

todo |

### report()

    report() : \CGExtensions\reports\report_defn

Get the report definition.

#### Returns

\CGExtensions\reports\report_defn

#

Inherited from
  \CGExtensions\reports\report_generator

## Tags

todo |

### start()

    start() : void

A callback function when the report is started.

#

Inherited from
  \CGExtensions\reports\report_generator

## Tags

todo |

### finish()

    finish() : void

A callback function for when the report is finished.

#

Inherited from
  \CGExtensions\reports\report_generator

## Tags

todo |

### class.formatted_report_generator.php