2014-12-04 195 views
0

我在處理SSRS的MVC Web項目中有一個類。 當我在IIS機器上運行應用程序時,我可以訪問報告。 從網絡上的另一臺計算機運行時,給我「請求失敗,HTTP狀態401:未經授權。」 報表服務器擁有自己獨特的憑證。不接受網絡上的登錄憑據HTTP狀態401請求失敗:未經授權。 SSRS

附件類的一部分

reportViewer.ProcessingMode = ProcessingMode.Remote; 
reportViewer.ServerReport.ReportServerUrl = new Uri(System.Configuration.ConfigurationManager.AppSettings["RSUrl"]); 
reportViewer.PromptAreaCollapsed = true; 
reportViewer.ShowParameterPrompts = false; 
reportViewer.SizeToReportContent = true; 
reportViewer.InteractivityPostBackMode = InteractivityPostBackMode.AlwaysAsynchronous; 
reportViewer.AsyncRendering = false; 

if (reportType == "GRP") 
{ 
    reportViewer.ShowToolBar = false; 
    reportViewer.ShowPageNavigationControls = false; 
} 
else //if (reportType == "RPT") 
{ 
    reportViewer.ShowToolBar = true; 
    reportViewer.ShowPageNavigationControls = true; 
} 

strReportName = _reqObjNm; 
strReportPath = System.Configuration.ConfigurationManager.AppSettings["RSPath"]; 
reportViewer.ServerReport.ReportPath = strReportPath + strReportName; 

string RSUsername = System.Configuration.ConfigurationManager.AppSettings["RSUserName"]; 
string RSPwd = System.Configuration.ConfigurationManager.AppSettings["RSPwd"]; 
string RSDomain = System.Configuration.ConfigurationManager.AppSettings["RSDomainFull"]; 

//App_Start.ReportViewerCredentials rvCreds = new App_Start.ReportViewerCredentials(RSUsername, RSPwd, RSDomain); 
//reportViewer.ServerReport.ReportServerCredentials = rvCreds; 

reportViewer.Visible = true; 
if (reportViewer.ServerReport.GetParameters().Count > 0) // HERE breaks :(

回答

0

如果我明白你的問題正確,我認爲你需要一個「ReportUser」添加到遠程SSRS服務器作爲本地用戶和SSRS管理員授予本地「ReportUser」用戶帳戶正確訪問權限。

+0

本地帳戶+ NLB =可預測的失敗。使用域帳戶訪問虛擬服務器名稱,或者如果要使用本地帳戶在本地框上運行任務,請配置主機條目,以便虛擬服務器名稱專門使用本地計算機。 NLB經常通過IP地址緩存路由(而不是純循環平衡),這可能會導致「但本地帳戶有時可以工作」的情況。但是,如果您路由到NLB中的其他節點,本地帳戶將失敗。 http://stackoverflow.com/a/32119709/4051367 – Kiquenet 2015-09-17 17:45:31

+0

我同意你的意見。我給出了一個可以讓用戶啓動並運行的解決方案。該操作沒有指定他如何遠程訪問服務器或網絡命名。我期望如果使用域控制器,那麼該帳戶將是首選。創建本地帳戶可以快速解決帳戶問題,而不是最具擴展性的問題。 – 2015-09-17 17:52:18

相關問題