0
votes

i am trying to interface ssrs reporting services from my asp.net web application. I am creating the URL dynamically based on the search parameters, and trying to fetch the report, but its not being fetched.

    //report server name + reports folder name
    strRedirectURL = ConfigurationManager.AppSettings["ReportServerURL"];
    //report name
    strRedirectURL = strRedirectURL + "ExportSearch";
    //report rendering constant
    strRedirectURL = strRedirectURL + "&rs:Command=Render";
    //parameters
    strRedirectURL = strRedirectURL + strParamString;
    //show/hide parameters on report
    strRedirectURL = strRedirectURL + "&rc:parameters=false&rs:ClearSession=true";
    //report format
    strRedirectURL = strRedirectURL + "&rs:Format=Excel";

    System.Diagnostics.Process objProcess = new System.Diagnostics.Process();
    objProcess.StartInfo.FileName = "iexplore.exe";
    objProcess.StartInfo.Arguments = strRedirectURL;
    objProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

    objProcess.Start();
    objProcess.Close();

I executed the above code on my local, and it worked fine. But when deployed on server, to test, its not working. The created URL looks something like this,

http://[Server_Name]/ReportServer/?%2fReports%2fExportSearch&rs:Command=Render&rc:parameters=false&rs:ClearSession=true&rs:Format=Excel

I checked the URL and it works fine when tried to launch from separate browser window. When application tries to open this URL, it doesn't open.

1
What response do you get back? When you say doesn't open, do you get an error?Paddy
@Paddy no error. I logged the URL, and the url is getting created correctly. It only shows loading, and then back to search screen.anshul

1 Answers

0
votes

Are you attempting to embed the report in your website?

Spawning a new IE process on the WebServer is not going to help the client much?
The piece of code you are using is for a windows app - some tips here.

But for a Web application, I think using the webviewer control would be the best way to go. some tips here.