• 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

Send Outlook 2010 email using PHP

Changing font color in javascript

woocommerce get_order_report_data to show order_item_id

Not able to access model in the controller mautic

Laravel - How to properly generate unique slugs from article titles?

Laravel eloquent update record without loading from database

Insert a DIV after the 6th product only once in WooCommerce category archives

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

Check if my GET request has Header: Token

How to convert a carbon into string, to take the date only?

Select option from dropdown menu with PHP and mySql

Convert string to lowercase AND then convert it to its original form in PHP, is it possible?

Render the content of default_filter.php in Joomla front-end

cakephp save drag and drop list order to database

Show date difference as "20" instead of "20 years ago"

About Contact Privacy policy Terms and conditions