• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

PHPExcel_IOFactory::createWriter causes wrong behaviour

phpphpexcel


PHP Snippet 1:

07:31:12 Create new PHPExcel object 
07:31:12 Set properties 
07:31:12 Add some data 
07:31:12 Rename sheet 
07:31:12 Write to Excel2007 format 

PHP Snippet 2:

    $objWriter =  PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');

    header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
    header('Content-Disposition: attachment;filename="workbook1.xlsx"');
    header('Cache-Control: max-age=0');

    ob_end_clean();
    $objWriter->save('php://output');
    exit;

Related Snippets

how to use extended ASCII instead of unicode in PHP

How to change HTML structure inside WP <head>

How to use a PHP MVC Controller, one thats invoked by calling a URL, to call and execute more than one function? [duplicate]

httpd.conf on Windows: can't locate API model structure `php8_module`

How to create a video stream from a single dynamic image in PHP

How to create a scheduler application in php

Log file is not being written in Laravel 5.5

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

PHP how to detect if running on arm64 cpu?

how to retrieve the first and last instance of a row in pdo dataset

GuzzleHttp Hangs When Using Localhost

PHP, how to convert Int value to Week days

Wordpress 'post_type_link' hides permalink

Dynamic table in HTML using MySQL and php

PHP Fatal error: Class not found - PHPUnit

About Contact Privacy policy Terms and conditions