Framework  3.9
APIExcelFormatter Class Reference

Excel Formatter - formats items as a Microsoft Excel file. More...

+ Inheritance diagram for APIExcelFormatter:
+ Collaboration diagram for APIExcelFormatter:

Public Member Functions

 format ($items)
 Override this function to provide your format definition. More...
 
- Public Member Functions inherited from APIFormatter
 getClass ()
 

Additional Inherited Members

- Public Attributes inherited from APIFormatter
 $parent
 

Detailed Description

Excel Formatter - formats items as a Microsoft Excel file.

Author
andy

Definition at line 95 of file api_helper.inc.

Member Function Documentation

◆ format()

APIExcelFormatter::format (   $items)

Override this function to provide your format definition.

The results should be sent to the output buffer, via 'echo' or equivalent.

Parameters
array$itemsthe list of DataItems to be formatted

Reimplemented from APIFormatter.

Definition at line 97 of file api_helper.inc.

98  {
99  $view = new DataListView($items);
100  if (count($items))
101  {
102  $obj = $items[0];
103 
104  foreach($obj->getFields() as $field => $type)
105  {
106  if ($obj->filter && $obj->filter->isExcluded($field)) continue;
107  $view->column($field, "{".$field."}");
108  }
109  }
110 
111  $view->writeExcelFile($this->getClass()."Results.xls");
112  }
DataListView displays a list of DataItems (or InnerJoinResults) in tabular format.
Definition: data_view.inc:56

The documentation for this class was generated from the following file: