cognetif/report-generator

This package is abandoned and no longer maintained. No replacement package was suggested.

Report Generator - Generate Excel, CSV, HTML Reports

v1.2.0 2021-04-15 14:47 UTC

This package is auto-updated.

Last update: 2024-02-26 14:51:30 UTC


README

This library allows you to easily create reports in XLSX, CSV, or HTML format.

Installation

Installation with composer:

$ compose require cognetif/report-generator

Usage

  1. Create or extend theCognetif\ReportGenerator\Report.
  2. Report::setHeaders($headers = []) function used to set the report headers.
  3. Report::addDataLine($line = []) function used to add a single line of data to the report body.
  4. Report::addDataSet($dataSet = []) function used to add the entire data set to the body.
  5. Report::makeCsv() or Report::makeHtml() or Report::makeExcel() functions used to control what type to output.
  6. Report::generate() to build and return the report.
  7. Report::clear() to clear the body dataset from the report. Headers are maintained.
  8. Report::setMaxMbMemory(int $mb = 5) to set the max number of megabytes used to generate a CSV report (Default: 5MB).
  9. Report::getDataSet() get the entire dataset as an array. No headers.
  10. Report::maxDataColumns() get the entire column count of the data set line with the most columns.

License

This library is protected under the MIT license. Please read the terms of the License.

Issues / Contributing

Contributions are welcome and encouraged. This library is open source but maintained by Cognetif.com. Please feel free to open an issue at: https://gitlab.com/cognetif-os/report-generator