Witam. Chciałem utworzyć arkusz kalkulacyjny z wykorzystaniem skryptu PHPExcel. Udało się, lecz przy wypełnianiu komórek w momencie pojawienia się polskiego znaku słowo jest urywane. Jak temu zaradzić?
Kod:
$file_name='arkusz.xls';
// PHPExcel
include 'PHPExcel/PHPExcel.php';
include 'PHPExcel/PHPExcel/IOFactory.php';
$PHPExcel = new PHPExcel();
$PHPExcel->removeSheetByIndex(0);
// Create sheet
$Sheet=$PHPExcel->createSheet();
$Sheet->setCellValue ('B2', 'Kolumna 1');
$Sheet->setCellValue ('C2', 'Kolumna 2');
$Sheet->setCellValue ('D2', 'Kolumna 3');
$Sheet->setCellValue ('E2', 'Kolumna 4');
$Sheet->setCellValue ('F2', 'Różnica');
$Sheet->getColumnDimension('C')->setWidth(12);
$Sheet->getColumnDimension('E')->setWidth(12);
$Sheet->getColumnDimension('F')->setWidth(12);
// Genere excel file
header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="'.$file_name.'"'); header('Cache-Control: max-age=0');
$Writer = PHPExcel_IOFactory::createWriter($PHPExcel, 'Excel5');
$Writer->setTempDir("./");
$Writer->save('php://output');
Pozdrawiam,
ladovnik
Ten post edytował ladovnik 1.09.2010, 12:40:04