public void SetReportDataSourceCredentials(DatasourceCredentials[] credentials)
        {
            DatasourceCredentialsCollection credentials2 = this.m_executionSession.Credentials;

            credentials2.Clear();
            if (credentials != null)
            {
                foreach (DatasourceCredentials datasourceCred in credentials)
                {
                    credentials2.Add(datasourceCred);
                }
            }
            this.ProcessAndStoreReportParameters(this.m_executionSession.ExecutionInfo.ReportParameters);
        }
Exemplo n.º 2
0
        public DataSourcePromptCollection GetReportDataSourcePrompts(out bool allCredentialsSatisfied)
        {
            GetAllReportDataSourcesAndSharedDataSets(out RuntimeDataSourceInfoCollection runtimeDataSources, out RuntimeDataSetInfoCollection _);
            DatasourceCredentialsCollection datasourceCredentialsCollection = new DatasourceCredentialsCollection();

            foreach (DatasourceCredentials credential in m_executionSession.Credentials)
            {
                DataSourceInfo byOriginalName = runtimeDataSources.GetByOriginalName(credential.PromptID);
                if (byOriginalName != null && byOriginalName.CredentialsRetrieval == DataSourceInfo.CredentialsRetrievalOption.Prompt)
                {
                    datasourceCredentialsCollection.Add(credential);
                }
            }
            runtimeDataSources.SetCredentials(datasourceCredentialsCollection, DataProtectionLocal.Instance);
            ServerDataSourceSettings   serverDatasourceSettings = new ServerDataSourceSettings(isSurrogatePresent: true, allowIntegratedSecurity: true);
            DataSourcePromptCollection promptRepresentatives    = runtimeDataSources.GetPromptRepresentatives(serverDatasourceSettings);

            allCredentialsSatisfied = !runtimeDataSources.NeedPrompt;
            return(promptRepresentatives);
        }