C# 在利用ReportExecutionService执行SSRS脚本方面,我可以得到一些帮助吗

C# 在利用ReportExecutionService执行SSRS脚本方面,我可以得到一些帮助吗,c#,reporting-services,C#,Reporting Services,以下是我的控制台应用程序代码: private static void CreateSSRSPDF() { string FullFilePath = "C:\\NewIbidReport"; ReportExecutionService rs = new ReportExecutionService(); string format = "PDF"; string reportPath = "http://bushssrs02dev/ReportServer

以下是我的控制台应用程序代码:

private static void CreateSSRSPDF()
{
    string FullFilePath = "C:\\NewIbidReport";

    ReportExecutionService rs = new ReportExecutionService();

    string format = "PDF";
    string reportPath = "http://bushssrs02dev/ReportServer/Sam%20"+"-"+"%20Student%20Reports/IBid%20Audit%20Analysis.rdl";
    string mimeType = "application/pdf";

    ParameterValue[] parameters = new ParameterValue[1];
    parameters[0] = new ParameterValue();
    parameters[0].Name = "StudentStatus";
    parameters[0].Value = "Active";

    byte[] results = RenderReport(rs, format, mimeType, reportPath, parameters);
    WriteFile(results, FullFilePath);
}

private static byte[] RenderReport(ReportExecutionService rs, string format, string mimeType, string reportPath, ParameterValue[] parameters)
{
    rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

    //Prepare Render arguments
    string historyID = null;
    string deviceInfo = String.Empty;
    string extension = String.Empty;
    string encoding = String.Empty;
    Warning[] warnings = null;
    string[] streamIDs = null;
    byte[] results = null;

    rs.LoadReport(reportPath, historyID);
    rs.SetExecutionParameters(parameters, "en-us");
    results = rs.Render(format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);

    return results;
} 
行rs.LoadRedport行引发错误:

System.Web.Services.Protocols.SoapException
  HResult=0x80131501
  Message=The path of the item 'http://bushssrs02dev/ReportServer/Sam%20-%20Student%20Reports/IBid%20Audit%20Analysis.rdl' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. ---> Microsoft.ReportingServices.Diagnostics.Utilities.InvalidItemPathException: The path of the item 'http://bushssrs02dev/ReportServer/Sam%20-%20Student%20Reports/IBid%20Audit%20Analysis.rdl' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash.
  Source=System.Web.Services
  StackTrace:
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at MyServices.MyReportSerivce.ReportExecutionService.LoadReport(String Report, String HistoryID) in c:\users\prykiel\source\repos\Factodo399\MyServices\Web References\MyReportSerivce\Reference.cs:line 287
   at Factodo399.Program.RenderReport(ReportExecutionService rs, String format, String mimeType, String reportPath, ParameterValue[] parameters) in c:\users\prykiel\source\repos\Factodo399\Factodo399\Program.cs:line 53
   at Factodo399.Program.CreateSSRSPDF() in c:\users\prykiel\source\repos\Factodo399\Factodo399\Program.cs:line 36
   at Factodo399.Program.Main(String[] args) in c:\users\prykiel\source\repos\Factodo399\Factodo399\Program.cs:line 16

我可以在浏览器中为报告路径键入此URL并执行SSRS报告,但我想从控制台应用程序执行它

您确定需要
http://bushssrs02dev/ReportServer
以及报告路径字符串中的url编码?你试过只写报告的名字吗?我假设报表客户端负责编码,并且已经知道报表将在哪个服务器上。我一定会尝试,我刚刚开始使用它,所以我想确定我有正确的语法。这样做了吗?非常感谢您在这方面的帮助。您确定需要
http://bushssrs02dev/ReportServer
以及报告路径字符串中的url编码?你试过只写报告的名字吗?我假设报表客户端负责编码,并且已经知道报表将在哪个服务器上。我一定会尝试,我刚刚开始使用它,所以我想确定我有正确的语法。这样做了吗?我非常感谢你在这方面帮助我。