public function create()
 {
     $objPHPExcel = $this->report->getPHPExcelObj();
     $params = $this->param;
     // Rename sheet
     $this->report->log("Created Worksheet");
     $objPHPExcel->getActiveSheet()->setTitle($this->report->fileName);
     // Add some data
     $this->report->log("Adding Report Content");
     $objPHPExcel->setActiveSheetIndex(0);
     $worksheet = $objPHPExcel->getActiveSheet();
     $worksheet->SetCellValue('B2', 'Penta Insurance Broker Services Inc.');
     $worksheet->SetCellValue('B3', 'Sample Graph - Vertical Bar');
     $dataSample['January'] = array("January", 200);
     $dataSample['February'] = array("February", 156);
     $dataSample['March'] = array("March", 100);
     $dataSample['April'] = array("April", 120);
     $dataSample['Jeff'] = array("Jeff", 190);
     $chartSampleGen = new ChartControl("Sample", "Sample Graph/Chart Title");
     $chartSampleGen->createVerticalBar(600, 250);
     $chartSampleGen->setData($dataSample);
     $chartSamplePath = $chartSampleGen->render($worksheet, 'B5');
     $worksheet->SetCellValue('B7', 'Graph caption, explanations');
     $worksheet->getColumnDimension('B')->setAutoSize(true);
     $worksheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
     $this->report->end($this->report->getFormat());
 }
Пример #2
0
 public function init()
 {
     parent::init();
     $this->data = new BarData();
     $this->data->labels = [];
     $this->data->datasets = [];
 }