2014-08-29 88 views
1

我有一個關於SSRS驗證的問題。我在一臺實時服務器上部署了我的報告,在使用實時URL訪問這些報告後,顯示「身份驗證失敗」錯誤。我的目的是,來自宇宙的任何人都可以訪問報告,但我該怎麼做?即讓每個人訪問該特定的URL來查看報告。 我在這裏使用SQL Server身份驗證。部署到Live Server後,SSRS報告Permiision被拒絕

當我在本地服務器上運行該應用程序時,它運行良好,因爲它有權訪問該報告,但故事在我嘗試訪問放置在活動服務器上的報告時開始。

在此先感謝

回答

0

,如果你想允許公衆指責它自己的報告,您需要使用報表查看器控件,用出這是很漫長的過程,要允許報表服務器是公衆開放。所以很容易爲什麼。

  1. 過去波紋管代碼中創建新頁面,並在形式上標籤

    <rsweb:ReportViewer ID="MainReportViewer" runat="server" BackColor="White" 
           Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos=" (Collection)" 
           ProcessingMode="Remote" ShowBackButton="False" ShowFindControls="False" 
           ShowPageNavigationControls="False" SizeToReportContent="True" 
           ToolBarItemBorderColor="White" ToolBarItemHoverBackColor="White" 
           WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%"> 
           <ServerReport 
            ReportServerUrl="" /> 
          </rsweb:ReportViewer> 
    
  2. 下面的代碼幫助你設置你彙報路徑,用戶名,密碼和等,這樣纔有利於指責您的報告,請過去下面的代碼到CA文件

    保護無效Page_Init(對象發件人,EventArgs的) {

    string UserName = ConfigurationManager.AppSettings["SsrsUserName"]; 
        string Password = ConfigurationManager.AppSettings["SsrsPassword"]; 
        string Domain = ConfigurationManager.AppSettings["SsrsDomain"]; 
        string ReportServerRoot = ConfigurationManager.AppSettings["SsrsServerRoot"]; 
        string ReportServerPath = ConfigurationManager.AppSettings["SsrsReportServerPath"]; 
    
        MainReportViewer.ProcessingMode = ProcessingMode.Remote; 
        IReportServerCredentials irsc = new CustomReportCredentials(UserName, Password, Domain); 
        MainReportViewer.ServerReport.ReportServerCredentials = irsc; 
        MainReportViewer.ServerReport.ReportServerUrl = new Uri(ReportServerRoot); 
        MainReportViewer.ServerReport.ReportPath = ReportServerPath + "YourReportFileName"; 
    

    }

+0

給予上CustomReportCredentials功能錯誤,請放置代碼CustomReportCredentials ...等待disperately – 2014-08-29 13:38:15

+0

請給我你的錯誤信息,因爲如果你給正確的權限在該用戶名的報告會被罰款。上面的代碼工作正常。 – 2014-08-30 10:14:25

+0

親愛的Beruk.Berhane對不起,我遲到了回覆CustomReportCredentials()當我寫行IReportServerCredentials irsc = new CustomReportCredentials(UserName,Password,Domain)時,沒有發現此定義。它表示CustomReportCredentials在當前上下文中不存在.... – 2014-09-02 06:19:35

0

對不起延遲迴復。請找到customreportcreadentials類: - public class CustomReportCredentials:Microsoft.Reporting.WebForms.IReportServerCredentials { private string _UserName; 私人字符串_PassWord; 私人字符串_DomainName;

public CustomReportCredentials(string UserName, string PassWord, string DomainName) 
    { 
     _UserName = UserName; 
     _PassWord = PassWord; 
     _DomainName = DomainName; 
    } 
    public CustomReportCredentials(string UserName, string PassWord) 
    { 
     _UserName = UserName; 
     _PassWord = PassWord; 
    } 
    public System.Security.Principal.WindowsIdentity ImpersonationUser 
    { 
     get { return null; } 
    } 

    public ICredentials NetworkCredentials 
    { 
     get { return new NetworkCredential(_UserName, _PassWord, _DomainName); } 
    } 

    public bool GetFormsCredentials(out Cookie authCookie, out string user, 
    out string password, out string authority) 
    { 
     authCookie = null; 
     user = password = authority = null; 
     return false; 
    } 
}