• 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

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed. WHAT?

Exact alternate to mcrypt_encrypt in PHP 7.2

AJAX call fails with SyntaxError: Unexpected end of JSON input

Symfony process run throws exception - executing on command line works

No result using makeStyles Material UI in react 18

Error when uploading certain .png files "Interlace handling should be turned on when using png_read_image"

Laravel 5 controller sending JSON integer as string

Laravel database insert with combining array and string

PHPExcel export HTML table to xlsx

Not able to access model in the controller mautic

merge all files in directory to one text file

Limit WooCommerce products in cart only from one custom taxonomy

Log file is not being written in Laravel 5.5

How to send upload image through email

About Contact Privacy policy Terms and conditions