SSRS Export to Excel

  • Hi Team,

    I have an c# windows application. On export button an excel should popup , this connects to SSRS and then provides the excel.

    Issue: When user clicks on Export Button , the report server is opening up in the Internet Explorer,this should not happen, the excel report should be available directly.

  • You haven't posted enough information about how you connect to the report server. Are you using URL parameters, the Reporting Services Web Service, or some feature in the Report Viewer control? Can you post the code behind your export button?

  • Hi,

    This is the code

    System.Diagnostics.Process objProcess = new System.Diagnostics.Process();

    objProcess.StartInfo.FileName = "abc.rdl";

    objProcess.StartInfo.Arguments = stringRedirectURL;//"http://server/reports/...."

    objProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

    objProcess.Start();

    objProcess.Close();

  • I think your going about it the wrong way. If you just want to display the data in excel then you dont even need SSRS in the middle.

    https://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.extensions%28v=vs.120%29.aspx

    Here are the extensions for MS EXcel that you need to use in your C# code

    Jayanth Kurup[/url]

  • GonnaCatchIT (8/9/2015)


    Hi,

    This is the code

    System.Diagnostics.Process objProcess = new System.Diagnostics.Process();

    objProcess.StartInfo.FileName = "abc.rdl";

    objProcess.StartInfo.Arguments = stringRedirectURL;//"http://server/reports/...."

    objProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

    objProcess.Start();

    objProcess.Close();

    Have a read of Export a Report Using URL Access. It describes how to craft a URL that will render the report in Excel format and display a "File Save" dialog.

  • No , I dont need any code on how to export. The system is built to use SSRS to export excel and changing the code is not in scope.

    It seems more of browser issue now, as on IE 8 , browser is not shown. But if its IE 11 then browser opens up before is downloaded

  • If you can't change it, then there's no way to assure complete browser version compatibility and prevent the browser appearing. You either need to follow Andrew Ps advice, or you would need to modify the application to use the ReportingService/ReportViewer class to render the report properly. An example of that code is found here:

    http://www.jensbits.com/2012/01/23/generate-sql-server-reporting-services-ssrs-report-as-pdf-from-url-with-vb-net-or-c-net/

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply