Condividi tramite


Metodo ServerReport.GetDataSources (Boolean%)

Recupera le informazioni sulle origini dati utilizzate per un rapporto. Ad esempio, indica se sono state specificate tutte le credenziali necessarie per tali origini dati.

Spazio dei nomi:  Microsoft.Reporting.WinForms
Assembly:  Microsoft.ReportViewer.WinForms (in Microsoft.ReportViewer.WinForms.dll)

Sintassi

'Dichiarazione
Public Function GetDataSources ( _
    <OutAttribute> ByRef allCredentialsSet As Boolean _
) As ReportDataSourceInfoCollection
public ReportDataSourceInfoCollection GetDataSources(
    out bool allCredentialsSet
)
public:
ReportDataSourceInfoCollection^ GetDataSources(
    [OutAttribute] bool% allCredentialsSet
)
member GetDataSources : 
        allCredentialsSet:bool byref -> ReportDataSourceInfoCollection 
public function GetDataSources(
    allCredentialsSet : boolean
) : ReportDataSourceInfoCollection

Parametri

  • allCredentialsSet
    Tipo: Boolean%
    [out] Indica se sono state specificate tutte le credenziali necessarie per le origini dati utilizzate dal rapporto del server.

Valore restituito

Tipo: Microsoft.Reporting.WinForms.ReportDataSourceInfoCollection
Oggetto ReportDataSourceInfoCollection contenente oggetti ReportDataSourceInfo.

Note

Questo metodo restituisce i nomi delle origini dati e le stringhe di richiesta dell'utente di tutte le origini dati utilizzate nel rapporto configurate per la richiesta di credenziali.

Esempi

Nell'esempio seguente vengono elencate tutte le origini dati che richiedono credenziali per il rapporto del server correntemente attivo in un controllo ReportViewer.

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);
   }
}

Vedere anche

Riferimenti

ServerReport Classe

Overload GetDataSources

Spazio dei nomi Microsoft.Reporting.WinForms