none
Rendering .rdlc to Excel in Firefox on Mac

    Question

  • I'm rendering a localreport to Excel. Works fine in IE and Firefox on a PC, but Excel can't open it on the Mac. I found this KB article that somewhat describes the problem for an SSRS 2005 server report, but I'm not using SSRS to render a server report, it's a .rdlc.

     

    The article said that the Microsoft.ReportingServices.ExcelRendering.dll is modified by the hotfix/sp2. I installed SP2 for SS, but I'm not sure how to proceed from here. I copied this dll on our server in the bin folder of our web application (the file wasn't part of our solution before), but users on a Mac still cannot view the report (Excel just hangs trying to open it).

     

    Any help would be greatly appreciated. Here is the export part of my code (Asp.Net 2.0):

     

    private void Export(LocalReport report, string format)

    {

    Warning[] warnings;

    string[] streamids;

    string mimeType;

    string encoding;

    string extension;

    string deviceInfo;

    string contentType;

    switch (format)

    {

    case "PDF":

    deviceInfo =

    "<DeviceInfo>" +

    " <OutputFormat>PDF</OutputFormat>" +

    " <PageWidth>8.5in</PageWidth>" +

    " <PageHeight>11in</PageHeight>" +

    " <MarginTop>1in</MarginTop>" +

    " <MarginLeft>1in</MarginLeft>" +

    " <MarginRight>1in</MarginRight>" +

    " <MarginBottom>1in</MarginBottom>" +

    "</DeviceInfo>";

    contentType = "application/pdf";

    break;

    case "EXCEL":

    deviceInfo =

    "<DeviceInfo>" +

    " <SimplePageHeaders>False</SimplePageHeaders>" +

    "</DeviceInfo>";

    contentType = "application/vnd.ms-excel";

    break;

    default:

    deviceInfo =

    "<DeviceInfo>" +

    " <OutputFormat>PDF</OutputFormat>" +

    " <PageWidth>8.5in</PageWidth>" +

    " <PageHeight>11in</PageHeight>" +

    " <MarginTop>1in</MarginTop>" +

    " <MarginLeft>1in</MarginLeft>" +

    " <MarginRight>1in</MarginRight>" +

    " <MarginBottom>1in</MarginBottom>" +

    "</DeviceInfo>";

    contentType = "application/pdf";

    break;

    }

     

    byte[] bytes = report.Render(format, deviceInfo, out mimeType, out encoding, out extension, out streamids, out warnings);

    HttpContext.Current.Response.Clear();

    HttpContext.Current.Response.ClearHeaders();

    HttpContext.Current.Response.ContentType = contentType;

     

    if(format == "EXCEL") HttpContext.Current.Response.AddHeader("Content-disposition", "attachment; filename=MyReport.xls");

     

    HttpContext.Current.Response.BinaryWrite(bytes);

    HttpContext.Current.Response.End();

    }

     

    Tuesday, August 05, 2008 6:03 PM