Welcome Guest, Not a member yet? Register   Sign In
PHPExcel Export Problem
#1

Please help me, 

This site can’t be reached
The webpage at http://localhost/xxx/xxx/x might be temporarily down or it may have moved permanently to a new web address.
ERR_INVALID_RESPONSE

This is my controller

Code:
function exportData()
    {
        $id = $this->uri->segment(3);
                include APPPATH.'third_party/PHPExcel/PHPExcel.php';
        $excel = new PHPExcel();
        $excel->getProperties()
        ->setCreator('Admin')
        ->setLastModifiedBy('Admin')
        ->setTitle("result")
        ->setSubject("Admin")
        ->setDescription("Admin")
        ->setKeywords("Data Result");
                $excel->setActiveSheetIndex(0)->setCellValue('A1', "Data");
        $excel->getActiveSheet()->getStyle('A1')->applyFromArray($style_col);


        $excel->setActiveSheetIndex(0)->setCellValue('A2', $id);
        $excel->getActiveSheet()->getStyle('A2')->applyFromArray($style_row);
        $excel->getActiveSheet()->getColumnDimension('A')->setWidth(10);

        $excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
            $excel->getActiveSheet(0)->setTitle("Data Result");
        $excel->setActiveSheetIndex(0);


        $filename='result_detail_'.$id.'.xlsx';
                header('Content-Type: application/vnd.ms-excel');
        header('Content-Disposition: attachment;filename="'.$filename.'"');
        header('Cache-Control: max-age=0');

        $write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
        $write->save('php://output');
}
Mac OSX, PHP 7.2.15, i was try in PHP 7.3 and not working. 
im using plugin PHPExcel
Reply
#2

That has been discontinued you should use this now.

PhpSpreadsheet
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB