how to rotate excel

Topics: Developer Forum, Project Management Forum, User Forum
Nov 14, 2009 at 11:45 AM

how to rotate excel
it should be like right to left.
i'm using excel2007
waiting for reply

Nov 14, 2009 at 11:55 AM

This feature should already be available with the following methods

// set right-to-left column direction

// set left-to-right column direction (the default)

// inspect the column direction
$objWorksheet->getRightToLeft(); // true=right-to-left, false=left-to-right

Nov 14, 2009 at 12:46 PM

i hav created object like

require_once 'Classes/PHPExcel/Worksheet.php';

$objWorksheet=new PHPExcel_Worksheet();

and tried method


but it is not working.



Nov 14, 2009 at 1:36 PM


/** Error reporting */

/** PHPExcel */
require_once './Classes/PHPExcel.php';
/** PHPExcel_IOFactory */
require_once './Classes/PHPExcel/IOFactory.php';

// Create new PHPExcel object
$objPHPExcel = new PHPExcel();

// Set properties
$objPHPExcel->getProperties()->setCreator("Mark Baker")
                             ->setLastModifiedBy("Mark Baker")
                             ->setTitle("Office 2007 XLSX Test Document")
                             ->setSubject("Office 2007 XLSX Test Document")
                             ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
                             ->setKeywords("office 2007 openxml php")
                             ->setCategory("Test result file");

// Add some data
            ->setCellValue('A1', 'Hello')
            ->setCellValue('B2', 'world!')
            ->setCellValue('C1', 'Hello')
            ->setCellValue('D2', 'world!');

// Rename sheet

// Set active sheet index to the first sheet, so Excel opens this as the first sheet

// Save Excel 2007 file
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');