• 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

Failing validation doesn't stop code execution in livewire component

Coinpayments create_transaction "ERROR: Invalid command!"

How do I truncate a decimal in PHP?

WooCommerce: Add/display Product or Variation custom field everywhere

Sagepay Error The Vendor failed to provide a RedirectionURL

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

PHP: Convert any string to UTF-8 without knowing the original character set, or at least try

Display a success custom notice after Placing an Order in WooCommerce

Batch request Google Calendar php API

Creating a config file in PHP

Submitting a form with ajax in Wordpress

PHP - Store information with NO database

Which is faster php date functions or carbon?

Substitute integers and dots with regex [duplicate]

PHP drop down list using array's and foreach (else and for) code

About Contact Privacy policy Terms and conditions