• 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

Why getting "Build step 'Execute shell' marked build as failure" error while creating a backup tar for files

Laravel 5 issue with wherePivot

Merge column values from two arrays to form an indexed array of associative arrays

Log file is not being written in Laravel 5.5

How to average columns of data from multiple, flat arrays?

Install mysql client in docker image

I want to display default profile image if user do not have profile image

oauth-private.key does not exist or is not readable

retrieve data from database using session

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

Cut an arabic string

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

CSV to PHP class properties

Apply session id from request header

Multiply each value in array using array_map function

About Contact Privacy policy Terms and conditions