public function createStreamedResponse(Spreadsheet $spreadsheet, $type, $status = 200, $headers = array(), $writerOptions = array())
    {
        $writer = IOFactory::createWriter($spreadsheet, $type);

        if (!empty($writerOptions)) {
            $this->applyOptionsToWriter($writer, $writerOptions);
        }

        return new StreamedResponse(
            function () use ($writer) {
                $writer->save('php://output');
            },
            $status,
            $headers
        );
    }
public function createStreamedResponse(Spreadsheet $spreadsheet, $type, $status = 200, $headers = array(), $writerOptions = array())
    {
        $writer = IOFactory::createWriter($spreadsheet, $type);

        if (!empty($writerOptions)) {
            $this->applyOptionsToWriter($writer, $writerOptions);
        }

        return new StreamedResponse(
            function () use ($writer) {
                $writer->save('php://output');
            },
            $status,
            $headers
        );
    }
public function createStreamedResponse ( Spreadsheet $ spreadsheet , $ type , $ status = 200 , $ headers = array ( ) , $ writerOptions = array ( ) ) { $ writer = IOFactory :: createWriter ( $ spreadsheet , $ type ) ; if ( ! empty ( $ writerOptions ) ) { $ this -> applyOptionsToWriter ( $ writer , $ writerOptions ) ; } return new StreamedResponse ( function ( ) use ( $ writer ) { $ writer -> save ( 'php://output' ) ; } , $ status , $ headers ) ; }
Return a StreamedResponse containing the file

@param Spreadsheet $spreadsheet
@param string $type
@param number $status
@param array $headers
@param array $writerOptions
@return \Symfony\Component\HttpFoundation\StreamedResponse
Return a StreamedResponse containing the file