• 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

Display a product custom field only in WooCommerce Admin single orders

Make certain characters of a word from string bold

error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

Get WooCommerce product variation attribute terms in admin products general box

Store / Website Column in Magento 2 Admin Grid - Custom Module

Getting values for an enum?

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

Phpunit partial mock + proxy Entity

Laravel Schedule not sending email

Split array into 4-element chunks then implode into strings

How to fix Call to undefined method AppModelsTableName::factory?

Twig - How to check if variable is a number / integer

how to search for a file with php

PhP how to calculate moments with variables rows

Laravel-fopen: failed to open stream: Permission denied

About Contact Privacy policy Terms and conditions