hello i'm using joomla and i'm attempting to create a choice the user will have the ability to download a csv or stand out file on the table that's presently presented.

i'm attempting to use PHPExcel in order to obtain the file. I've produced an export.php file:

    {
    $objXLS = new PHPExcel();

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");;
header("Content-Disposition: attachment;filename=File.xls"); 
header("Content-Transfer-Encoding: binary ");


    $objSheet = $objXLS->setActiveSheetIndex(0);
    //$objSheet->setCellValue(cell, value);
    $objSheet->setCellValue('A1', '1');
    $objSheet->setCellValue('A2', '2');
    $objSheet->setCellValue('A3', '3');
    $objSheet->setCellValue('A4', '4');
    $objSheet->setCellValue('A5', '5');


    $objSheet->setCellValue('B5', date('H:i:s'));

    $objXLS->getActiveSheet()->getColumnDimension("A")->setAutoSize(true);
    $objXLS->getActiveSheet()->getColumnDimension("B")->setAutoSize(true);

    $objXLS->getActiveSheet()->setTitle('Test Stats');

    $objXLS->setActiveSheetIndex(0);


    $objWriter = PHPExcel_IOFactory::createWriter($objXLS, 'Excel5');
    //$objWriter->save('php://output');
    exit;

}
}

the file will get the data on the table, card inserts it into an stand out sheet and results it to download but i'm not in a position to access this file because of the joomla limitations.

after i attempt to input the code to my model and refer to it as the file that arrives may be the entire page or even the file is printed within the site page as garbage.

how can grante use of this file in order to open it up inside a new tab or something like that. or it is possible to simpler method to export these details for an stand out file or csv using AJAX or Jquery?

thanks

Your condition probably would be that the Joomla framework will output some additional HTML which isn't required for this special situation I believe what you are attempting to do is fairly much like that which was requested in this question. The gist is you need to make your own action inside your controller, and taking advantage of and extra format=raw parameter inside your URL.

Have a look only at that link. They did exactly what you would like PHPExcel & Joomla