I have a method that sends a report out to the browser in excel format. It works fine if I pass it a report but when I pass it a report book I get the error "Excel found unreadable Content in 'MyReportName.xls'. Do you want to recover the contents of this workbook? If you trust the source of the workbook click Yes. When I click Yes it generates the workbook with all of the tabs in place the only issue is the first tab has the correct name and the remaining tabs are named Recovered_Sheet1, Recovered_Sheet2 ..... Recovered_Sheet10.
private void WriteToExcel(IReportDocument report)
ReportProcessor reportProcessor = new ReportProcessor();
RenderingResult result = reportProcessor.RenderReport("xls", report, null);
Response.ContentType = result.MimeType;
Response.Expires = -1;
Response.Buffer = true;
Thanks in advance for any and all help!