次の方法で共有


ReportServerCredentials.SetFormsCredentials メソッド

Specifies that forms authentication is to be used when connecting to the report server and provides the forms credentials.

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

構文

'宣言
'使用

パラメータ

  • authCookie
    An authentication cookie used by the report server.
  • userName
    The user name that will be used to connect to the report server.
  • password
    The password that will be used to connect to the report server.
  • authority
    The authority to use when authenticating the user, for example, a Windows domain name.

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 クラス
ReportServerCredentials メンバ
Microsoft.Reporting.WinForms 名前空間