• 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

Not able to override collapsible.js in magento 2

how can I set a session variable in Drupal 8 and get it in a php script?

str_word_count() function doesn't display Arabic language properly

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

Log file is not being written in Laravel 5.5

Create tags in laravel post publishing

PHP my timezone is no setting up in PHP.ini File in xampp

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

How can I get a div content in php

Mobile browsers are adding .html to filename on download

Installing Composer - Internal Error

Laravel update hasMany relationship using saveMany

Unable to uninstall brew php from homebrew

Converting array to string and then back in PHP

Webscraping Symfony/Panther: Can't get HTML

About Contact Privacy policy Terms and conditions