• 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

Wordpress how to get the post thumbnail inside a figure tag

PHP array, move keys and values to new array, but mix it up

Redis Command To Sort Keys

PHP and WebView - Cookie doesn't are the same

PHP to search within txt file and echo the whole line

Malformed MIME header error in Symfony 5.3

How can I remove the "Advanced" panel of all blocks in WordPress block editor?

Losing session data after POST from third party website

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

merging two arrays with specified index

str_replace or preg_replace random number from string

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

Correctly determine if date string is a valid date in that format

PHP AWS Cognito 'Error executing "SignUp" : ResourceNotFoundException : User pool client XXXX does not exist

Get keys from associative array [duplicate]

About Contact Privacy policy Terms and conditions