protected function setPrinting(PHPExcel $phpExcel)
    {
        $optionsRenderer = $this->getOptionsRenderer();

        $phpExcel->getProperties()
            ->setCreator('https://github.com/zfc-datagrid/zfc-datagrid')
            ->setTitle($this->getTitle());

        /*
         * Printing setup
         */
        $papersize   = $optionsRenderer['papersize'];
        $orientation = $optionsRenderer['orientation'];
        foreach ($phpExcel->getAllSheets() as $sheet) {
            /* @var $sheet \PHPExcel_Worksheet */
            if ('landscape' == $orientation) {
                $sheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
            } else {
                $sheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT);
            }

            switch ($papersize) {
                case 'A5':
                    $sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5);
                    break;

                case 'A4':
                    $sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);
                    break;

                case 'A3':
                    $sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3);
                    break;

                case 'A2':
                    $sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A2_PAPER);
                    break;
            }

            // Margins
            $sheet->getPageMargins()->setTop(0.8);
            $sheet->getPageMargins()->setBottom(0.5);
            $sheet->getPageMargins()->setLeft(0.5);
            $sheet->getPageMargins()->setRight(0.5);

            $this->setHeaderFooter($sheet);
        }

        $phpExcel->setActiveSheetIndex(0);
    }
protected function setPrinting(PHPExcel $phpExcel)
    {
        $optionsRenderer = $this->getOptionsRenderer();

        $phpExcel->getProperties()
            ->setCreator('https://github.com/zfc-datagrid/zfc-datagrid')
            ->setTitle($this->getTitle());

        /*
         * Printing setup
         */
        $papersize   = $optionsRenderer['papersize'];
        $orientation = $optionsRenderer['orientation'];
        foreach ($phpExcel->getAllSheets() as $sheet) {
            /* @var $sheet \PHPExcel_Worksheet */
            if ('landscape' == $orientation) {
                $sheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
            } else {
                $sheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT);
            }

            switch ($papersize) {
                case 'A5':
                    $sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5);
                    break;

                case 'A4':
                    $sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);
                    break;

                case 'A3':
                    $sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3);
                    break;

                case 'A2':
                    $sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A2_PAPER);
                    break;
            }

            // Margins
            $sheet->getPageMargins()->setTop(0.8);
            $sheet->getPageMargins()->setBottom(0.5);
            $sheet->getPageMargins()->setLeft(0.5);
            $sheet->getPageMargins()->setRight(0.5);

            $this->setHeaderFooter($sheet);
        }

        $phpExcel->setActiveSheetIndex(0);
    }
protected function setPrinting ( PHPExcel $ phpExcel ) { $ optionsRenderer = $ this -> getOptionsRenderer ( ) ; $ phpExcel -> getProperties ( ) -> setCreator ( 'https://github.com/zfc-datagrid/zfc-datagrid' ) -> setTitle ( $ this -> getTitle ( ) ) ; /*
         * Printing setup
         */ $ papersize = $ optionsRenderer [ 'papersize' ] ; $ orientation = $ optionsRenderer [ 'orientation' ] ; foreach ( $ phpExcel -> getAllSheets ( ) as $ sheet ) { /* @var $sheet \PHPExcel_Worksheet */ if ( 'landscape' == $ orientation ) { $ sheet -> getPageSetup ( ) -> setOrientation ( PHPExcel_Worksheet_PageSetup :: ORIENTATION_LANDSCAPE ) ; } else { $ sheet -> getPageSetup ( ) -> setOrientation ( PHPExcel_Worksheet_PageSetup :: ORIENTATION_PORTRAIT ) ; } switch ( $ papersize ) { case 'A5' : $ sheet -> getPageSetup ( ) -> setPaperSize ( PHPExcel_Worksheet_PageSetup :: PAPERSIZE_A5 ) ; break ; case 'A4' : $ sheet -> getPageSetup ( ) -> setPaperSize ( PHPExcel_Worksheet_PageSetup :: PAPERSIZE_A4 ) ; break ; case 'A3' : $ sheet -> getPageSetup ( ) -> setPaperSize ( PHPExcel_Worksheet_PageSetup :: PAPERSIZE_A3 ) ; break ; case 'A2' : $ sheet -> getPageSetup ( ) -> setPaperSize ( PHPExcel_Worksheet_PageSetup :: PAPERSIZE_A2_PAPER ) ; break ; } // Margins $ sheet -> getPageMargins ( ) -> setTop ( 0.8 ) ; $ sheet -> getPageMargins ( ) -> setBottom ( 0.5 ) ; $ sheet -> getPageMargins ( ) -> setLeft ( 0.5 ) ; $ sheet -> getPageMargins ( ) -> setRight ( 0.5 ) ; $ this -> setHeaderFooter ( $ sheet ) ; } $ phpExcel -> setActiveSheetIndex ( 0 ) ; }
Set the printing options.

@param PHPExcel $phpExcel
Set the printing options .