• 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

Facebook SDK error: Cross-site request forgery validation failed. Required param "state" missing from persistent data

Stop caching for PHP 5.5.3 in MAMP

Confirm Leave on External Links in Wordpress

Add customer email and phone in "Order" column to admin orders list on Woocommerce

Show only featured products in Woocommerce shop page

I'm trying to write a clean url for my website using the $_SERVER['REQUEST_URI'] in php

Set quantity minimum, maximum and step at product level in Woocommerce

how to remove %20 in the url in php

How to programmatically find public properties of a class from inside one of it's methods

Laravel Delete and Update

WHERE IN array binding in DB::raw laravel 5.4

How to install ZeroMQ for PHP on an Alpine Linux container?

How to implement placeholder in a php file for moodle plugin?

How to insert Google Adsense Code in PHP script?

SlimExceptionHttpNotFoundException

About Contact Privacy policy Terms and conditions