Note that there are some explanatory texts on larger screens.

plurals
  1. POCakePHP excel download troubleshooting
    primarykey
    data
    text
    <p>I'm trying to follow <a href="https://stackoverflow.com/questions/5298741/cakephp-excel-csv-export-component">this solution</a> to export data to excel but when I click the download link it just says "Server Error. May be down for maintenance....etc" </p> <p>The only thing I had to change from the tutorial is the name of the Csv helper. The tutorial specifies "Csv.php" but I had to name it "CsvHelper.php". When I print the variable that goes to this view, it displays the array. However, when I remove this and just have the code listed exactly as it appears in that linked post from above I get a server error</p> <pre><code>HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. </code></pre> <p>These are the files that I had to add to my server as directed by the "tutorial"</p> <pre><code>//Helper /App/View/Helper/CsvHelper.php //Vendor /App/Vendor/excel/PHPExcel.PHP /App/Vendor/excel/PHPExcel/ //contains the rest of PHPExcel //view /App/View/Orders/download.ctp //Tutorial specifies /App/View/Homes/download.ctp so I made sure to change the link accordingly in the view which actually "links" to this </code></pre> <p>As I mentioned previously when I print the array on download.ctp see this</p> <pre><code>Array ( [0] =&gt; Array ( [Order] =&gt; Array ( [id] =&gt; 1 [userid] =&gt; 2 [order_status] =&gt; completed [email] =&gt; test@gmail.com [total] =&gt; 8.00 ) ) </code></pre> <p>My array's structure matches that of the tutorial which is</p> <pre><code>$orders[0]['Order']; </code></pre> <p>Is there something I have to configure with CakePHP for downloading files? I have no idea where to go from here.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload