Skip to content

Instantly share code, notes, and snippets.

@SerjRamone
Created July 12, 2013 11:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SerjRamone/5983779 to your computer and use it in GitHub Desktop.
Save SerjRamone/5983779 to your computer and use it in GitHub Desktop.
Битрикс: Экспорт в Excel
if ($bExcel)
{
$APPLICATION->RestartBuffer();
// hack. any '.default' customized template should contain 'excel' page
$this->__templateName = '.default';
Header("Content-Type: application/force-download");
Header("Content-Type: application/octet-stream");
Header("Content-Type: application/download");
Header("Content-Disposition: attachment;filename=tasks.xls");
Header("Content-Transfer-Encoding: binary");
$this->IncludeComponentTemplate('excel');
die();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment