SSRS报告未通过动态网址

时间:2015-05-13 08:30:33

标签: c# asp.net reporting-services ssrs-2008-r2

我正在尝试从我的asp.net Web应用程序连接ssrs报告服务。我正在根据搜索参数动态创建URL,并尝试获取报告,但未获取该报告。

    //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();

我在我的本地执行了上面的代码,它工作正常。但是当部署在服务器上,进行测试时,它无法正常工作。创建的URL看起来像这样,

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

我检查了网址,尝试从单独的浏览器窗口启动时工作正常。当应用程序尝试打开此URL时,它不会打开。

1 个答案:

答案 0 :(得分:0)

您是否尝试将报告嵌入您的网站?

WebServer 上生成新的IE进程不会对客户端有多大帮助?
您正在使用的代码段用于Windows应用程序 - 一些提示here

但是对于 Web 应用程序,我认为使用webviewer控件将是最好的方法。一些提示here

相关问题