2012-07-22 62 views
1

我需要將動態參數傳遞給我的報告服務。以編程方式將參數傳遞給Reporting Services

參數名稱是PCName

的處理模式是遠程,我能參數傳遞給報告,如果我手動登錄到報告服務器,但我想programagically通過。

這是我的ASP代碼的副本。

<asp:ScriptManager id='scriptManager' runat='server' /> 
<rsweb:ReportViewer ID="ReportViewer1" 
        runat="server" 
        ProcessingMode="Remote" 
        Font-Names="Verdana" 
        Font-Size="8pt" 
        InteractiveDeviceInfos="(Collection)" 
        WaitMessageFont-Names="Verdana" 
        WaitMessageFont-Size="14pt" 


        Width="95%" 
        Height="99%" ShowDocumentMapButton="False" 
    ShowPromptAreaButton="False" Visible="true"> 

<ServerReport ReportPath="/Services/Logon" 
       ReportServerUrl="http://reports/reportserver/" /> 

</rsweb:ReportViewer> 
+0

你有沒有嘗試過這樣的http://報告/的reportserver PCName =測試 – HatSoft 2012-07-22 08:42:56

回答

1

你應該從你的代碼中創建的報表後面的參數,並將其傳遞到報表查看器控件如下

ReportParameter param = new ReportParameter("PCName", "parameter value"); 
this.ReportViewer1.ServerReport.SetParameters(new ReportParameter[] { param }); 
this.ReportViewer1.ServerReport.Refresh(); 
相關問題