SSRS exporting to excel from Report Viewer is not respecting boolean critera


  • Symptom:

    What's happening is that we are selecting a  set of criteria eg: start date,  drop down filter and a bit field.  After running the report against this criteria it comes up in the report viewer with the correct results.


    However after we export the current results to Excel the results in Excel are different because it seems

    that exporting re-ran the report without the selected bit field when SSRS should have taken the current run and converted it. This isn't happening on all bit fields either  which is the oddest part. However all of the bit parameters are setup the same in the RDL.


    We're Loading the report into and rendering it in the Report Viewer control and then leveraging the Report Viewer's Render Routine to export on a button click.

    The result to Excel.

    <asp:imagebutton ImageUrl="/Images/excel.png" id="btnExportExcel" runat="server" ToolTip="Export to Formatted Excel" Height="20" Width="20" />


    ...logic to setup the out parameters in the Render routine.

    bytes = ReportViewer1.ServerReport.Render("EXCEL", Nothing, mimeType, encoding, extension, streamids, warnings)


    Response.Buffer = True


    Response.ContentType = mimeType

    Response.AddHeader("content-disposition", "attachment; filename=" & ReportViewer1.ServerReport.ReportPath.Split("/")(2) & "." + extension)





    I wanted to know if anyone has seen this odd behavior and if there's situation where the server would re-render the report when exporting to a particular format? I would also like to add that no errors came up either.

    • Edited by Chris W 5 Tuesday, February 04, 2014 9:52 PM updated end.
    Tuesday, February 04, 2014 9:50 PM

All replies

  • Could you please let me know the defailed version of your report server and report viewer control?
    Monday, February 10, 2014 8:10 AM
  • Report Viewer 2008

    ProductVersion   FileVersion      FileName

    --------------   -----------      --------

    10.0.30319.1     10.0.30319.1     ...\Microsoft.ReportViewer.Common.dll

    10.0.30319.1     10.0.30319.1    ...\Microsoft.ReportViewer.WebForms.dll


    Report Server

    SQL Server 2008 R2  Report Server Version

    Microsoft SQL Server Reporting Services Version 10.50.2769.0 



    2008 RDL's

    <Report xmlns=""


    Tuesday, February 18, 2014 7:56 PM
  • I tried several different RDL files with the same version as your reporting service and report viewer control. However, unfortunately, I could not reproduce your issue. You could go ahead to check executionlog3 views in report server database. In this view, you could see the parameter value passed to render the report.

    Besides, since you run the report in web page firstly and then export to Excel. The second request to Excel should be based on the data in your session. You could get that information from Source column of executionlog3 view. And TimeDataRetrieval and RowCount should be 0 too since it is unnecessary to retrieve data again.

    If the parameter is correct with the boolean parameter set and Excel is really based on session data. It means that the data is not retrieved again and parameter to retrieve data should be correct. Then the problem will be in process phase or rendering phase. In that situation, since it is specific to that RDL file and that boolean parameter, I suggest you open a ticket to Microsoft support center to request help since they could collect RDL and data to reproduce your issue and do further investigation.

    Wednesday, February 26, 2014 9:25 AM
  • Thanks again, I will try that checking the executionlog2 views, if nothing comes up I will open a ticket.

    Monday, March 03, 2014 7:09 PM