• 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

array_map triple dimensional array [duplicate]

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

Fatal error: Array callback has to contain indices 0 and 1

Add New Parameter to Existing URL using htaccess

Message: Set sys_temp_dir in your php.ini after installed composer

PHPUnit (Phar) Fatal Error Only When Test Fails

Why rand() every time I refresh the page?

Unable to guess the mime type as no guessers are available Laravel 5.2

Codeigniter, Severity: error --> Exception: Too few arguments to function, admin dashboard shows HTTP error 500

Yii2: How to download backup files using spanjeta/yii2-backup?

Connecting an HTML webpage to a SQL Server

nginx err_connection_refused, can anyone help me?

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

laravel MVC execution flow

retrieve data from database using session

About Contact Privacy policy Terms and conditions