2

レポート サーバーで SSRS 2008 R2 レポートを実行しています。Report Manager または Web サービス URL を使用してレポートにアクセスすると、問題なく動作します。

http://mycomputer/ReportServer

http://mycomputer/Reports

ReportViewer を WebForms Web サイトに追加して、

http://mycomputer/reportserver 

レポートへのレポート パスを使用すると、VS.net の Web サーバーを使用して Web サイトを実行すると、アクセス拒否エラーが発生します。

ユーザー 'mycomputer\myusername' に付与されたアクセス許可は、この操作を実行するには不十分です。(rsAccessDenied)

以下は、私が aspx ページで使用している正確なコードです。

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" Font-Names="Verdana"
    Font-Size="8pt" InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana"
    WaitMessageFont-Size="14pt" Width="712px">
    <ServerReport ReportPath="/MyReports" ReportServerUrl="http://mycomputer/reportserver" />
</rsweb:ReportViewer>

mycomputer \ myusername は、マシンの管理者です。また、ReportManager の管理者として追加しました。

管理者モードでIEを使用して実行しています。

他に何がアクセス拒否の問題を引き起こしている可能性がありますか?

問題を抱えている他の人を読みましたが、それらのほとんどは 2008R2 用ではないため、彼らが何をしたかを試す方法を理解できませんでした。IIS を構成する必要はなく、レポートへのアクセスを許可する IUSR もありません。

SSRS ログには、他の情報なしで同じエラー メッセージが表示されるだけです。

4

1 に答える 1

2

IReportServerCredentials を実装するインスタンス クラスを作成すると、問題が解決するはずです。次のクラスを追加し、次のように呼び出します。

ReportViewer1.ServerReport.ReportServerCredentials = new ReportServerCredentials("username", "pwd", "domain");

/// <summary>
/// Local implementation of IReportServerCredentials
/// </summary>
public class ReportServerCredentials : IReportServerCredentials
{
    private string _userName;
    private string _password;
    private string _domain;

    public ReportServerCredentials(string userName, string password, string domain)
    {
        _userName = userName;
        _password = password;
        _domain = domain;
    }

    public WindowsIdentity ImpersonationUser
    {
        get
        {
            // Use default identity.
            return null;
        }
    }

    public ICredentials NetworkCredentials
    {
        get
        {
            // Use default identity.
            return new NetworkCredential(_userName, _password, _domain);
        }
    }

    public bool GetFormsCredentials(out Cookie authCookie, out string user, out string password, out string authority)
    {
        // Do not use forms credentials to authenticate.
        authCookie = null;
        user = password = authority = null;
        return false;
    }
}

Phil Clewes に感謝:リンク

于 2012-10-02T01:47:18.287 に答える