• 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

I want to display a sweetalert after the inserting of data in my database

How to upload mpdf file after generating to s3 bucket in php

PHP error: "The zip extension and unzip command are both missing, skipping."

sort() not affecting original array while inside foreach loop

storagelogs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

advanced custom fields wordpress custom class

Component install error: JInstaller: :Install: File does not exist

Class AppHttpControllersUserController Does Not Exist

How to install PHP composer inside a docker container

Error Class "LaravelFortifyFeatures" not found

how to see if database exists with PDO [duplicate]

SlimExceptionHttpNotFoundException

Live search query using JS and PHP for QA forum

MySQL upgrade causing unexpected results on simple WHERE clauses

Yii2: How do I debug console commands?

About Contact Privacy policy Terms and conditions