hi all how can I get vertical text in Excel as shown in the attached image using pear spreadsheet package. thanks
But I need to display in Excel using spreadsheet package.I tried pear commands in the spreadsheet .but it doesn't get in vertical style
I tried the below code but text is not getting in vertical style in Excel.please help me <?php // Include PEAR::Spreadsheet_Excel_Writer require_once "Writer.php"; // Create an instance $xls =& new Spreadsheet_Excel_Writer(); $sheetTitleFormat =& $xls->addFormat(array('bold'=>1, 'size'=>10)); //$sheetTitleFormat=& $xls->addFormat(array('vAlign'=>'vcenter')); // Send HTTP headers to tell the browser what's coming $xls->send("test.xls"); // Add a worksheet to the file, returning an object to add data to $sheet =& $xls->addWorksheet('Binary Count'); $xls->addFormat(array('vAlign'=>'vcenter')); $sheet->write(0,0,'Name',$sheetTitleFormat); $sheet->write(0,1,'Address',$sheetTitleFormat); $sheet->write(0,2,'Town',$sheetTitleFormat); $sheet->write(0,3,'City',$sheetTitleFormat); $col=0; $row=2; // Write some numbers for ( $i=2;$i<11;$i++ ) { if($col==4) { $col=0; $row= $row+1; } // Use PHP's decbin() function to convert integer to binary $sheet->write($row,$col,decbin($i)); $col=$col+1; } // Finish the spreadsheet, dumping it to the browser $xls->close(); ?> PHP: