Hi, normally in my old components I used the file view.raw.php to export to csv
so i did a link like this one on the default.php:
<a href="index.php?option=com_component&view=viewname&format=raw" target="_blank"><img src="components/com_component/assets/spreadsheet.png" align="right" alt="CSV" title="Export to CSV"></a>
and then on the view.raw.php
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport( 'joomla.application.component.view');
// PEAR include for generating Excel files
require_once( 'Spreadsheet/Excel/Writer.php' );
class ComponentNameViewViewName extends View
{
var $_name = null;
function __construct()
{
parent::__construct();
$this->_name = 'view_report';
}
function display($tpl = null)
{
$user =& JFactory::getUser();
// report rows
$items = array();
// create excel file
$workbook = new Spreadsheet_Excel_Writer();
$workbook->send("reports_" . date("Ymd") . ".xls");
$items =& $this->get('data');
if (count($items)) {
$worksheet =& $wor
.
.
.
$workbook->close();
die;
}
}
?>
Now, by using your component in 3.2 i try to put the link and the raw file and doesn't connect, could you help me please ?