none
Exporting to PDF using ReportViewer control in a WebBrowser control RRS feed

  • Question

  • Hi,

    We have a CRM application that has built in Web Panels using the .net WebBrowser control.  I have written a ReportViewer web page, that uses the SSRS ReportViewer control, and allows the users to control the security of which reports they can view, within the CRM system, rather than using Windows security.

    This works really well, and has been working for some time, however the issue I have is when I export to PDF\Excel etc.  Because it opens a separate browser window,  I get the following error.

    "ASP.NET session has expired or could not be found"

    Of course the session is lost between the web browser control and the IE window it tries to open when creating the export file.  However if I run the same report using the standard Reporting Services ReportViewer web page it does work correctly.

    On closer investigation, I have found that when I export using the c# reportviewer control, it using a ReportSession, but when I export using the standard SSRS reportviewer web page is uses an ExecutionID.

    /Reserved.ReportViewerWebControl.axd?ReportSession=iczxhh2sg32hlt55p2du0g45
    /Reserved.ReportViewerWebControl.axd?ExecutionID=5pwphfuoq20qsgr02wovkn55

    I guess this is how they prevent this issue occuring, but I cannot see how to change the c# reportviewer control to use the ExecutionID when clicking the built in Export button.

    Does anyone know how to do this, or know another way to allow the export feature to work correctly when using the reportviewer control in a web page loaded in the WebBrowser control.

    Many thanks,

    Trevor

    Friday, November 23, 2018 6:16 PM