| Version | Date | Notes | By |
|---|---|---|---|
| 1.0 | 2023-06-21 | Initial release | ROB |
The excel reports extends the PHPSpreadsheetExporter class (one class for each scope, case and process). Similar to PDF reports, there is a class representing each valid excel component from the interface component system.
// Folder structure inside of ProcessesEngine/src/Services/Exporters
|--\ ExcelReportContentComponents
|--- BaseExcelComponent
|--- ChartProcess
|--- ExcelColumn
|--- ExcelPositionalHolder
|--- ExcelRow
|--- ExcelWorksheet
|--- FirstElementSimpleVerticalTable
|--- SimpleHorizontalTable
|--- SimpleProcessGrid
|--- SimpleTextArea
|--- SimpleVerticalTable
|--- ExcelCaseReportExporter
|--- ExcelProcessReportExporter
Any new component added that needs an excel version, needs to have a corresponding class created, that extends the BaseExcelComponent class. Use the constructor to obtain the relevant options for that interface system component. Then define the calculateDimensions() function and return an associative array with the width and height the component will occupy:
/**
* This function calculates the dimensions for this component
* (primarily height and width)
*/
public function calculateDimensions(): self
{
$this->dimensionsBox['height'] = 3; // 3 cells tall
$this->dimensionsBox['width'] = 6; // 6 cells wide
return $this;
}
Then, inside the renderToSheet() function, update the sheet (defined in ExcelWorksheet and accessible inside renderToSheet() via $this->getSheet()) using the standard code used for all excel layouts.