• 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

Composer Script echo

Create a new line whenever an array value reaches more than 10 characters

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

Elastic Beanstalk with Laravel Envoy

Update Total in checkout of Woocommerce with Ajax Request

Google API Heatmap Layer exception, why?

Need to display only array value in JSON output

php - add comma thousands separator but remove trailing zeros

Error Class "LaravelFortifyFeatures" not found

How to map the two arrays with a duplicate value?

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

Unable to match results of php hash_hmac() and coldfusion hmac()

Applying programmatically a coupon to an Order in WooCommerce3

PHP code for generating decent-looking coupon codes (mix of letters and numbers)

About Contact Privacy policy Terms and conditions