• 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

how to search for a file with php

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource [duplicate]

Google Calendar API batch request PHP

Filter WooCommerce products with post__in and additional meta queries

PHP Startup Unable to load dynamic library /usr/lib/php/20151012/php_mysqli.dll

Explain how this array transposing and flattening function works

Yii2 redirecting to previous page after login

MySQL order by field in Eloquent

Select option menu read from database and use it's values

printing all running session variable in laravel 5.1

How to make autocomplete work in foreach php loop? (vscode, intellisense)

How to Make Laravel Eloquent "IN" Query?

Target Individual Form Instance/Counter Inside A PHP While Loop

PHP-Sort array based on another array?

woocommerce_wp_select options array from product attribute terms

About Contact Privacy policy Terms and conditions