views:

15

answers:

2

I cannot render an excel file for download correctly using SSRS SDK for PHP. I can for a CSV, and I can render one for PDF inline. The contents of produced file is garbage when viewed in EXCEL. Here is my code:

$renderAs = new RenderAsEXCEL();

$result = $ssrs_report->Render2($renderAs, PageCountModeEnum::$Estimate, $Extension, $MimeType, $Encoding, $Warnings, $StreamIds);

header("Content-Type: application/vnd.ms-excel");

header("Content-Disposition: attachment; filename=\"".$reportName.".xls\";");

btw, I've tried many different MIME Content-Type values.

A: 

I've not used that library, but i have had great results from this one: http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/

Built it into many apps without having to think very much about it.

Byron Whitlock