Skip to content

Instantly share code, notes, and snippets.

@ildarkhasanshin
Forked from SerjRamone/component.php
Created September 25, 2018 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ildarkhasanshin/a2d6fdf39ff8ef1832adb055a8a2335f to your computer and use it in GitHub Desktop.
Save ildarkhasanshin/a2d6fdf39ff8ef1832adb055a8a2335f 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