次の方法で共有


ReportServerCredentials.SetFormsCredentials メソッド (Cookie, String, String, String)

 

公開日: 2016年7月

レポート サーバーへの接続時にフォーム認証が使用されることを指定し、フォームの資格情報を提供します。

名前空間:   Microsoft.Reporting.WinForms
アセンブリ:  Microsoft.ReportViewer.WinForms (Microsoft.ReportViewer.WinForms.dll 内)

構文

public void SetFormsCredentials(
    Cookie authCookie,
    string userName,
    string password,
    string authority
)
public:
void SetFormsCredentials(
    Cookie^ authCookie,
    String^ userName,
    String^ password,
    String^ authority
)
member SetFormsCredentials : 
        authCookie:Cookie *
        userName:string *
        password:string *
        authority:string -> unit
Public Sub SetFormsCredentials (
    authCookie As Cookie,
    userName As String,
    password As String,
    authority As String
)

パラメーター

  • authCookie
    Type: System.Net.Cookie

    レポート サーバーによって使用される認証クッキー。

  • userName
    Type: System.String

    レポート サーバーへの接続に使用するユーザー名。

  • password
    Type: System.String

    レポート サーバーへの接続に使用するパスワード。

  • authority
    Type: System.String

    ユーザーの認証時に使用する Microsoft Windows ドメイン名などの認証情報。

使用例

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;

namespace ReportServerCredentialsSample
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;

            reportViewer1.ServerReport.ReportPath = 
                @"/Adventureworks Sample Reports/Company Sales";

            reportViewer1.ServerReport.ReportServerCredentials.SetFormsCredentials(
                null, <UserName>, <Password>, <DomainName>);

            reportViewer1.RefreshReport();
        }
    }
}

関連項目

ReportServerCredentials クラス
Microsoft.Reporting.WinForms 名前空間

トップに戻る