Partager via


Méthode ServerReport.GetDataSources (Boolean%)

Récupère les informations sur les sources de données utilisées pour un rapport et indique notamment si toutes les informations d'identification requises ont été fournies pour les sources de données du rapport.

Espace de noms :  Microsoft.Reporting.WinForms
Assembly :  Microsoft.ReportViewer.WinForms (en Microsoft.ReportViewer.WinForms.dll)

Syntaxe

'Déclaration
Public Function GetDataSources ( _
    <OutAttribute> ByRef allCredentialsSet As Boolean _
) As ReportDataSourceInfoCollection
'Utilisation
Dim instance As ServerReport
Dim allCredentialsSet As Boolean
Dim returnValue As ReportDataSourceInfoCollection

returnValue = instance.GetDataSources(allCredentialsSet)
public ReportDataSourceInfoCollection GetDataSources(
    out bool allCredentialsSet
)
public:
ReportDataSourceInfoCollection^ GetDataSources(
    [OutAttribute] bool% allCredentialsSet
)
member GetDataSources : 
        allCredentialsSet:bool byref -> ReportDataSourceInfoCollection 
public function GetDataSources(
    allCredentialsSet : boolean
) : ReportDataSourceInfoCollection

Paramètres

  • allCredentialsSet
    Type : System.Boolean%
    [out] Indique si toutes les informations d'identification requises ont été fournies pour les sources de données utilisées par le serveur de rapports.

Valeur de retour

Type : Microsoft.Reporting.WinForms.ReportDataSourceInfoCollection
Collection ReportDataSourceInfoCollection contenant des objets ReportDataSourceInfo.

Notes

Cette méthode renvoie les noms des sources de données et les chaînes d'invite utilisateur des sources de données utilisées dans le rapport configuré pour demander des informations d'identification.

Exemples

L'exemple ci-dessous répertorie toutes les sources de données qui demandent des informations d'identification pour le rapport de serveur actif dans un contrôle 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);
   }
}

Voir aussi

Référence

ServerReport Classe

Surcharge GetDataSources

Espace de noms Microsoft.Reporting.WinForms