• 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

Converting alphabet letter to alphabet position in PHP [duplicate]

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

How to get array values using foreach in laravel

WordPress Subquery returns more than 1 row on SELECT

how to get the header value, if we don't know the value because the value is random from the server

Send POST data via raw JSON with Postman

Make certain characters of a word from string bold

How can I get user id from session in javascript?

Dropzone: Submit both form data and dropzone at once

Symfony process run throws exception - executing on command line works

Mobile browsers are adding .html to filename on download

How to override htaccees file for cache control header

Pass a select with mysqli_fetch_row to a table

How to validate Envato Purchase Code in PHP

LARAVEL: How to fetch id dynamically in a query builder?

About Contact Privacy policy Terms and conditions