Thanks for your reply. I wrote export.php code in controller, but it gives me error as follows
Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\CI3\application\libraries\koolreport\core\src\KoolReport.php:455)
Filename: excel/FileHandler.php
My Controller is as follows:
public function index()
{
$this->load->helper('url');
$this->load->database('MainiDM');
include APPPATH."reports\ExcelReport_Ex.php";
$report = new ExcelReport_Ex;
$report->run()->render();
$type = isset($_GET['type'])? $_GET['type'] : 'CSV';
if($type === 'XLSX')
{
$report->exportToXLSX('ExcelReportSpreadsheet')->toBrowser("ExcelReport.xlsx");
}
elseif($type === 'ODS')
{
$report->exportToODS('ExcelReportSpreadsheet')->toBrowser('ExcelReport.ods');
}
elseif($type === 'CSV')
{
$report->exportToCSV('ExcelReportSpreadsheet')->toBrowser('ExcelReport.csv');
}
}