Note that there are some explanatory texts on larger screens.

plurals
  1. POJoomla article exporting to excel
    primarykey
    data
    text
    <p>A bit more info on what we are trying to achieve.</p> <p>We have had reports written in PHP that will create a table on the screen and then if they select the Excel radio button and rerun the report it will output the table to Excel simply by outputting the following headers before outputting the table header("Content-Type: application/x-msexcel"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Disposition: attachment; filename=discussion.xls");</p> <p>When we have tried to reproduce the same report inside a Joomla article the report works fine but when we then try to output the report to Excel it does create an excel file but seems to output the whole page content and not just the table from the report (hope that makes sense)</p> <p>You can see the link at <a href="http://commculturecommunity.cloudaccess.net" rel="nofollow">http://commculturecommunity.cloudaccess.net</a> if you select test1 it will create the Excel output but when you open it you can see the test data but can also see the rest of the page content.</p> <p>Any help would be really appreciated.</p> <p>Thanks Richard</p> <p>================================================================================</p> <p>We have created an article in Joomla and have embedded this code (using sourcerer) as part of the article.</p> <pre><code>{source} &lt;?php $filename ="excelreport.xls"; $contents ="testdata1 \t testdata2 \t testdata3 \t \n"; header('Content-type: application/ms-excel'); header('Content-Disposition: attachment; filename='.$filename); echo $contents; ?&gt; {/source} </code></pre> <p>When we go to the page an Excel file is downloaded but when we open it in Excel it has included the whole form and not just the test data created above.</p> <p>Any help would really be appreciated</p> <p>Thanks Richard</p>
    singulars
    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