Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> PHPExcel a polskie znaki
ladovnik
post
Post #1





Grupa: Zarejestrowani
Postów: 60
Pomógł: 1
Dołączył: 25.11.2008
Skąd: Polska

Ostrzeżenie: (10%)
X----


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:
  1. $file_name='arkusz.xls';
  2.  
  3. // PHPExcel
  4. include 'PHPExcel/PHPExcel.php';
  5. include 'PHPExcel/PHPExcel/IOFactory.php';
  6.  
  7. $PHPExcel = new PHPExcel();
  8. $PHPExcel->removeSheetByIndex(0);
  9.  
  10. // Create sheet
  11. $Sheet=$PHPExcel->createSheet();
  12. $Sheet->setCellValue ('B2', 'Kolumna 1');
  13. $Sheet->setCellValue ('C2', 'Kolumna 2');
  14. $Sheet->setCellValue ('D2', 'Kolumna 3');
  15. $Sheet->setCellValue ('E2', 'Kolumna 4');
  16. $Sheet->setCellValue ('F2', 'Różnica');
  17.  
  18. $Sheet->getColumnDimension('C')->setWidth(12);
  19. $Sheet->getColumnDimension('E')->setWidth(12);
  20. $Sheet->getColumnDimension('F')->setWidth(12);
  21.  
  22. // Genere excel file
  23. header('Content-Type: application/vnd.ms-excel');
  24. header('Content-Disposition: attachment;filename="'.$file_name.'"');
  25. header('Cache-Control: max-age=0');
  26.  
  27. $Writer = PHPExcel_IOFactory::createWriter($PHPExcel, 'Excel5');
  28. $Writer->setTempDir("./");
  29. $Writer->save('php://output');


Pozdrawiam,
ladovnik

Ten post edytował ladovnik 1.09.2010, 12:40:04
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 07:30