次の方法で共有


ServerReport.GetDataSources メソッド (out Boolean)

Retrieves information about the data sources used for a report, including whether all required credentials have been supplied for the report data sources.

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

構文

'宣言
'使用

パラメータ

  • allCredentialsSet
    [out] Indicates whether all required credentials have been supplied for the data sources used by the server report.

戻り値

A ReportDataSourceInfoCollection containing ReportDataSourceInfo objects.

解説

This method returns the data source names and user prompt strings of any data sources used in the report that can prompt for credentials.

The following example lists all data sources that prompt for credentials for the server report currently active in a ReportViewer control.

private void button1_Click(object sender, EventArgs e)
{
   bool bCreds;

   ReportDataSourceInfoCollection rdsic=
      this.reportViewer1.ServerReport.GetDataSources(out bCreds);

   Debug.WriteLine("All credentials supplied: {0}", 
      bCreds.ToString());

   foreach (ReportDataSourceInfo rdsi in rdsic)
   {
      Debug.WriteLine(rdsi.Name + ":" + rdsi.Prompt);
   }
}

参照

リファレンス

ServerReport クラス
ServerReport メンバ
Microsoft.Reporting.WebForms 名前空間