public virtual ICatalogItemContext GetDataSetContext(string dataSetPath)
        {
            PreviewItemContext previewItemContext = new PreviewItemContext();

            previewItemContext.SetPath(dataSetPath, ItemPathOptions.None);
            return(previewItemContext);
        }
        public StoredReport GetCompiledReport(PreviewItemContext context)
        {
            ReportID     key    = new ReportID(context);
            StoredReport result = default(StoredReport);

            this.m_compiledReports.TryGetValue(key, out result);
            return(result);
        }
        public override ICatalogItemContext GetSubreportContext(string subreportPath)
        {
            PreviewItemContext previewItemContext = (PreviewItemContext)base.GetSubreportContext(subreportPath);
            string             text = this.MapUserProvidedPath(subreportPath);

            previewItemContext.SetPath(text, text, this.DefinitionSource, this.m_embeddedResourceAssembly);
            previewItemContext.OriginalItemPath = subreportPath;
            return(previewItemContext);
        }
        private PublishingResult GetCompiledReport(PreviewItemContext itemContext, bool rebuild, out ControlSnapshot snapshot)
        {
            StoredReport storedReport = null;

            if (!rebuild)
            {
                storedReport = this.m_catalogTempDB.GetCompiledReport(itemContext);
                if (storedReport != null && storedReport.GeneratedExpressionHostWithRefusedPermissions != this.GenerateExpressionHostWithRefusedPermissions)
                {
                    storedReport = null;
                }
            }
            if (storedReport == null)
            {
                byte[]           reportDefinition = this.m_catalog.GetReportDefinition(itemContext);
                PublishingResult publishingResult = ReportCompiler.CompileReport((ICatalogItemContext)itemContext, reportDefinition, this.GenerateExpressionHostWithRefusedPermissions, out snapshot);
                storedReport = new StoredReport(publishingResult, snapshot, this.GenerateExpressionHostWithRefusedPermissions);
                this.m_catalogTempDB.SetCompiledReport(itemContext, storedReport);
                foreach (DataSourceInfo dataSource in storedReport.PublishingResult.DataSources)
                {
                    if (!dataSource.IsReference && dataSource.CredentialsRetrieval != DataSourceInfo.CredentialsRetrievalOption.Integrated)
                    {
                        string text  = null;
                        string text2 = null;
                        this.m_catalog.GetReportDataSourceCredentials(itemContext, dataSource.Name, out text, out text2);
                        bool flag = !string.IsNullOrEmpty(text);
                        if (flag)
                        {
                            dataSource.SetUserName(text, DataProtectionLocal.Instance);
                        }
                        bool flag2 = text2 != null;
                        if (flag2)
                        {
                            dataSource.SetPassword(text2, DataProtectionLocal.Instance);
                        }
                        if (flag || flag2)
                        {
                            dataSource.CredentialsRetrieval = DataSourceInfo.CredentialsRetrievalOption.Store;
                        }
                        else if (string.IsNullOrEmpty(dataSource.Prompt))
                        {
                            dataSource.CredentialsRetrieval = DataSourceInfo.CredentialsRetrievalOption.None;
                        }
                        else
                        {
                            dataSource.CredentialsRetrieval = DataSourceInfo.CredentialsRetrievalOption.Prompt;
                        }
                    }
                }
            }
            this.m_securityValidator(itemContext, storedReport.PublishingResult);
            snapshot = storedReport.Snapshot;
            return(storedReport.PublishingResult);
        }
        public string[] GetDataSetNames(PreviewItemContext itemContext)
        {
            if (this.DataRetrieval.SupportsQueries)
            {
                return(new string[0]);
            }
            ControlSnapshot  controlSnapshot = default(ControlSnapshot);
            PublishingResult compiledReport  = this.GetCompiledReport(itemContext ?? this.m_itemContext, false, out controlSnapshot);

            return(compiledReport.DataSetsName ?? new string[0]);
        }
 public void SetPath(string pathForFileDefinitionSource, string fullyQualifiedPath, DefinitionSource definitionSource, Assembly embeddedResourceAssembly)
 {
     this.m_definitionSource = definitionSource;
     if (this.m_definitionSource == DefinitionSource.EmbeddedResource)
     {
         this.m_embeddedResourceAssembly = embeddedResourceAssembly;
     }
     if (definitionSource == DefinitionSource.File)
     {
         this.SetPath(pathForFileDefinitionSource, ItemPathOptions.None);
     }
     else
     {
         this.SetPath(string.Empty, ItemPathOptions.None);
     }
     this.m_previewStorePath = fullyQualifiedPath;
     base.m_ItemName         = PreviewItemContext.CalculateDisplayName(fullyQualifiedPath, definitionSource);
 }
 public ReportID(PreviewItemContext itemContext)
     : this(itemContext.PreviewStorePath, itemContext.DefinitionSource, itemContext.EmbeddedResourceAssembly)
 {
 }
        public void SetCompiledReport(PreviewItemContext context, StoredReport storedReport)
        {
            ReportID key = new ReportID(context);

            this.m_compiledReports[key] = storedReport;
        }
Example #9
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 ProcessingContextForDataSets(PreviewItemContext reportContext, ParameterInfoCollection parameters, IEnumerable dataSources, ReportProcessing.OnDemandSubReportCallback subReportCallback, LocalDataRetrievalFromDataSet.GetSubReportDataSetCallback subReportInfoCallback, IGetResource getResourceFunction, IChunkFactory chunkFactory, ReportRuntimeSetup reportRuntimeSetup, AspNetCore.ReportingServices.Interfaces.CreateAndRegisterStream createStreamCallback)
     : base(reportContext, WindowsIdentity.GetCurrent().Name, parameters, subReportCallback, getResourceFunction, chunkFactory, ReportProcessing.ExecutionType.Live, Thread.CurrentThread.CurrentCulture, UserProfileState.Both, UserProfileState.None, reportRuntimeSetup, createStreamCallback, false, new ViewerJobContextImpl(), new ViewerExtensionFactory(), DataProtectionLocal.Instance)
 {
     this.m_dataSources           = dataSources;
     this.m_subReportInfoCallback = subReportInfoCallback;
 }
 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);