diff --git a/Examples/01simple-download-xls.php b/Examples/01simple-download-xls.php index c1d670d..986e3ae 100644 --- a/Examples/01simple-download-xls.php +++ b/Examples/01simple-download-xls.php @@ -75,6 +75,14 @@ $objPHPExcel->setActiveSheetIndex(0); header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="01simple.xls"'); header('Cache-Control: max-age=0'); +// If you're serving to IE 9, then the following may be needed +header('Cache-Control: max-age=1'); + +// If you're serving to IE over SSL, then the following may be needed +header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past +header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified +header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1 +header ('Pragma: public'); // HTTP/1.0 $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); diff --git a/Examples/02types-xls.php b/Examples/02types-xls.php index 905dc9d..53d6cc5 100644 --- a/Examples/02types-xls.php +++ b/Examples/02types-xls.php @@ -109,6 +109,17 @@ $objPHPExcel->getActiveSheet()->getStyle('C11')->getNumberFormat()->setFormatCod $objPHPExcel->getActiveSheet()->setCellValue('A12', 'NULL') ->setCellValue('C12', NULL); +$objRichText = new PHPExcel_RichText(); +$objRichText->createText('你好 '); +$objPayable = $objRichText->createTextRun('你 好 吗?'); +$objPayable->getFont()->setBold(true); +$objPayable->getFont()->setItalic(true); +$objPayable->getFont()->setColor( new PHPExcel_Style_Color( PHPExcel_Style_Color::COLOR_DARKGREEN ) ); + +$objRichText->createText(', unless specified otherwise on the invoice.'); + +$objPHPExcel->getActiveSheet()->setCellValue('A13', 'Rich Text') + ->setCellValue('C13', $objRichText); $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true); diff --git a/Examples/02types.php b/Examples/02types.php index a66af90..6a5ea9d 100644 --- a/Examples/02types.php +++ b/Examples/02types.php @@ -109,7 +109,20 @@ $objPHPExcel->getActiveSheet()->getStyle('C11')->getNumberFormat()->setFormatCod $objPHPExcel->getActiveSheet()->setCellValue('A12', 'NULL') ->setCellValue('C12', NULL); +$objRichText = new PHPExcel_RichText(); +$objRichText->createText('你好 '); +$objPayable = $objRichText->createTextRun('你 好 吗?'); +$objPayable->getFont()->setBold(true); +$objPayable->getFont()->setItalic(true); +$objPayable->getFont()->setColor( new PHPExcel_Style_Color( PHPExcel_Style_Color::COLOR_DARKGREEN ) ); + +$objRichText->createText(', unless specified otherwise on the invoice.'); + +$objPHPExcel->getActiveSheet()->setCellValue('A13', 'Rich Text') + ->setCellValue('C13', $objRichText); + + $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true); $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);