2011-10-04 13 views
1

ReportExecutionService Webサービスを使用して、レポートパラメータを持つSSRSレポートを実行しています。私はパラメータを渡すのではなく、レポートにそれ自身の定義されたデフォルトのパラメータ値を使用させます。したがって、これを実行し、正しいレポートを取得することは問題ありません。しかし、結果ファイルを適切に指定できるように、パラメータの値を知る必要があります。ReportExecutionService.render()を実行した後のデフォルトのレポートパラメータの値を取得する

私は

byte[] returnArray = new byte[0]; 

    //get the SOAP call to the SSRS service started 
    ReportExecutionService rs = new ReportExecutionService(); 

    //reportParameters is an empty collection 
    rs.SetExecutionParameters(reportParameters, "en-us");    

    //The report renders successfully, using the default vales in the RDL 
    returnArray = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs); 

    //this is what I want to do, where the nonexistent executionParameters member 
    //contains the report parameters with default values defined in the report 
    String fileName = "reportName" + rs.executionParameters["startDate"].Value + "-" + rs.executionParameters["endDate"].Value + "." + extension; 

答えて

1

(私はそれがこれを行う見つけることができたことをReportExecutionServiceのないメンバーが存在しない、動作しません)このような何かを探していると思いますので、それはことが判明ReportExecutionServiceのExecutionInfoメンバには、レポート定義を読み込んだ後にパラメータとその既定値が含まれているため、次のように動作します。

 //get the SOAP call to the SSRS service started 
     ReportExecutionService rs = new ReportExecutionService(); 

     //this will contain all of the details needed for execution 
     ExecutionInfo execInfo = rs.LoadReport(reportLocation, historyID); 

     //and here are the default value(s) 
     execInfo.Parameters[i].DefaultValues[] 
関連する問題