-
So I posted this question on stack But it seems that (at the time of this writing) there's nothing wrong with what I am doing. So heres the issue (copied from stack) I have been following the docs on setting up multiple sheets, but when I go to download the file its:
I am unsure why. So heres how I do it: Controller Method:
Export Class
Buildings Sheet
Buildings view
I can't see anything wrong here with any of this, yet the file cannot be opened. I have tried to open it with I do have other sheets, but for simplicity I commented them out to see if one of them was having an issue. Alas even with just one sheet, it still won't open. Is it something wrong with how I download the excel file? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You might have some hidden chars before the output. Check for whitespaces in front of opening <?php tag. It's a know issue with PHP spreadsheet |
Beta Was this translation helpful? Give feedback.
-
So this might not be obvious to those who have this issue but:
The trick: I hope this helps someone. |
Beta Was this translation helpful? Give feedback.
So this might not be obvious to those who have this issue but:
The trick:
ob_end_clean
. It seems that the buffer does not get properly cleaned up, so there is an extra space added. But doing this, the file downloaded and was able to be opened.I hope this helps someone.