private void ResetExecution(bool forceRecompile)
 {
     if (forceRecompile)
     {
         DatasourceCredentialsCollection datasourceCredentialsCollection = null;
         ParameterInfoCollection         reportParameters = null;
         if (this.RecompileOnResetExecution)
         {
             datasourceCredentialsCollection = this.m_executionSession.Credentials;
             reportParameters = this.m_executionSession.ExecutionInfo.ReportParameters;
         }
         this.m_executionSession = new LocalExecutionSession();
         if (datasourceCredentialsCollection != null)
         {
             foreach (DatasourceCredentials item in datasourceCredentialsCollection)
             {
                 this.m_executionSession.Credentials.Add(item);
             }
         }
         this.m_executionSession.ExecutionInfo.ReportParameters = reportParameters;
     }
     else
     {
         this.m_executionSession.ResetExecution();
     }
 }
Exemplo n.º 2
0
 public void SetCredentials(DatasourceCredentialsCollection allCredentials, IDataProtection dataProtection)
 {
     if (allCredentials != null)
     {
         foreach (DatasourceCredentials allCredential in allCredentials)
         {
             this.SetCredentials(allCredential, dataProtection);
         }
     }
 }
Exemplo n.º 3
0
 public void SetCredentials(DatasourceCredentialsCollection allCredentials, IDataProtection dataProtection)
 {
     if (allCredentials == null)
     {
         return;
     }
     foreach (DatasourceCredentials allCredential in allCredentials)
     {
         SetCredentials(allCredential, dataProtection);
     }
 }
        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.º 5
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);
        }
Exemplo n.º 6
0
 public bool CredentialsAreSame(DatasourceCredentialsCollection creds, bool noCredentialsMeansSame, IDataProtection dataProtection)
 {
     if (noCredentialsMeansSame && (creds == null || creds.Count == 0))
     {
         return(true);
     }
     if ((this.m_collectionByPrompt == null || this.m_collectionByPrompt.Count == 0) != (creds == null || creds.Count == 0))
     {
         return(false);
     }
     if (creds != null && creds.Count != 0)
     {
         if (creds.Count != this.m_collectionByPrompt.Count)
         {
             return(false);
         }
         foreach (DatasourceCredentials cred in creds)
         {
             DataSourceInfo representative = this.m_collectionByPrompt.GetBucketByOriginalName(cred.PromptID).GetRepresentative();
             if (representative == null)
             {
                 return(false);
             }
             if (representative.CredentialsRetrieval != DataSourceInfo.CredentialsRetrievalOption.Prompt)
             {
                 return(false);
             }
             if (representative.GetPasswordDecrypted(dataProtection) != cred.Password)
             {
                 return(false);
             }
             if (representative.GetUserName(dataProtection) != cred.UserName)
             {
                 return(false);
             }
         }
         return(true);
     }
     return(true);
 }
Exemplo n.º 7
0
 public override ProcessingContext CreateProcessingContext(PreviewItemContext itemContext, ParameterInfoCollection parameters, IEnumerable dataSources, RuntimeDataSourceInfoCollection dataSourceInfoColl, RuntimeDataSetInfoCollection dataSetInfoColl, SharedDataSetCompiler sharedDataSetCompiler, DatasourceCredentialsCollection credentials, ReportProcessing.OnDemandSubReportCallback subReportCallback, IGetResource getResourceFunction, IChunkFactory chunkFactory, ReportRuntimeSetup runtimeSetup, AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream createStreamCallback)
 {
     return(new ProcessingContextForDataSets(itemContext, parameters, new DataSourceCollectionWrapper((ReportDataSourceCollection)dataSources), subReportCallback, this.m_subreportDataCallback, getResourceFunction, chunkFactory, runtimeSetup, (AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream)createStreamCallback));
 }
 public abstract ProcessingContext CreateProcessingContext(PreviewItemContext itemContext, ParameterInfoCollection parameters, IEnumerable dataSources, RuntimeDataSourceInfoCollection dataSourceInfoColl, RuntimeDataSetInfoCollection dataSetInfoColl, SharedDataSetCompiler sharedDataSetCompiler, DatasourceCredentialsCollection credentials, ReportProcessing.OnDemandSubReportCallback subReportCallback, IGetResource getResourceFunction, IChunkFactory chunkFactory, ReportRuntimeSetup runtimeSetup, CreateAndRegisterStream createStreamCallback);
        protected ProcessingContext CreateProcessingContext(ParameterInfoCollection reportParameters, IEnumerable dataSources, DatasourceCredentialsCollection credentials, IChunkFactory chunkFactory, CreateAndRegisterStream createStreamCallback, SubreportCallbackHandler subreportHandler)
        {
            RuntimeDataSourceInfoCollection dataSourceInfoColl = null;
            RuntimeDataSetInfoCollection    dataSetInfoColl    = null;

            this.GetAllReportDataSourcesAndSharedDataSets(out dataSourceInfoColl, out dataSetInfoColl);
            return(this.m_dataRetrieval.CreateProcessingContext(this.m_itemContext, reportParameters, dataSources, dataSourceInfoColl, dataSetInfoColl, this.GetCompiledDataSet, credentials, subreportHandler.OnDemandSubReportCallback, new GetResourceForLocalService(this.Catalog), chunkFactory, this.m_reportRuntimeSetupHandler.ReportRuntimeSetup, createStreamCallback));
        }
Exemplo n.º 10
0
 protected virtual OnDemandProcessingResult CreateSnapshotAndRender(ReportProcessing repProc, IRenderingExtension renderer, ProcessingContext pc, AspNetCore.ReportingServices.ReportProcessing.RenderingContext rc, SubreportCallbackHandler subreportHandler, ParameterInfoCollection parameters, DatasourceCredentialsCollection credentials)
 {
     return(repProc.RenderReport(renderer, DateTime.Now, pc, rc, null));
 }
Exemplo n.º 11
0
 public LocalExecutionSession()
 {
     ExecutionInfo = new LocalExecutionInfo();
     Credentials   = new DatasourceCredentialsCollection();
 }