• 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

Cannot retrieve error message using Symfony HttpClient if the response is not "ok"

Cant seem to get the Pagination to work on my WooCommerce REST API application?

Laravel Sanctum CSRF not authenticating

User pool client {id}does not exist

add uri parameter to Route name in laravel

How to find phpcs current default standard

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

How to keep value of selected value after form submission?

How to average columns of data from multiple, flat arrays?

php echo xml documents with header

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

How do I Post to .txt document before form submits

Sentry + Laravel: how to log an already catched Exception?

Send Outlook 2010 email using PHP

get attribute from class not working php 7

About Contact Privacy policy Terms and conditions