#485 Export for MS Excel web queries: format=spreadsheet

SVN:trunk[1711]
This commit is contained in:
Romain Quetiez
2011-12-13 14:21:13 +00:00
parent 8231420c44
commit 9197c6a17c
6 changed files with 170 additions and 2 deletions

View File

@@ -126,6 +126,19 @@ if (!empty($sExpression))
cmdbAbstractObject::DisplaySetAsCSV($oP, $oSet, array('fields' => $sFields));
break;
case 'spreadsheet':
$oP = new WebPage("iTop - Export for spreadsheet");
// Integration within MS-Excel web queries + HTTPS + IIS:
// MS-IIS set these header values with no-cache... while Excel fails to do the job if using HTTPS
// Then the fix is to force the reset of header values Pragma and Cache-control
header("Pragma:", true);
header("Cache-control:", true);
$sFields = implode(',', $aFields);
cmdbAbstractObject::DisplaySetAsHTMLSpreadsheet($oP, $oSet, array('fields' => $sFields));
break;
case 'xml':
$oP = new XMLPage("iTop - Export", true /* passthrough */);
cmdbAbstractObject::DisplaySetAsXML($oP, $oSet);