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

            previewItemContext.SetPath(dataSetPath, ItemPathOptions.None);
            return(previewItemContext);
        }
        public override ICatalogItemContext GetSubreportContext(string subreportPath)
        {
            PreviewItemContext obj  = (PreviewItemContext)base.GetSubreportContext(subreportPath);
            string             text = MapUserProvidedPath(subreportPath);

            obj.SetPath(text, text, DefinitionSource, m_embeddedResourceAssembly);
            obj.OriginalItemPath = subreportPath;
            return(obj);
        }
Exemplo n.º 3
0
        public string[] GetDataSetNames(PreviewItemContext itemContext)
        {
            if (DataRetrieval.SupportsQueries)
            {
                return(new string[0]);
            }
            ControlSnapshot snapshot;

            return(GetCompiledReport(itemContext ?? m_itemContext, rebuild: false, out snapshot).DataSetsName ?? new string[0]);
        }
 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);
			public ReportID(PreviewItemContext itemContext)
				: this(itemContext.PreviewStorePath, itemContext.DefinitionSource, itemContext.EmbeddedResourceAssembly)
			{
			}
		public void SetCompiledReport(PreviewItemContext context, StoredReport storedReport)
		{
			ReportID key = new ReportID(context);
			m_compiledReports[key] = storedReport;
		}
		public StoredReport GetCompiledReport(PreviewItemContext context)
		{
			ReportID key = new ReportID(context);
			m_compiledReports.TryGetValue(key, out StoredReport value);
			return value;
		}
Exemplo n.º 8
0
        private PublishingResult GetCompiledReport(PreviewItemContext itemContext, bool rebuild, out ControlSnapshot snapshot)
        {
            StoredReport storedReport = null;

            if (!rebuild)
            {
                storedReport = m_catalogTempDB.GetCompiledReport(itemContext);
                if (storedReport != null && storedReport.GeneratedExpressionHostWithRefusedPermissions != GenerateExpressionHostWithRefusedPermissions)
                {
                    storedReport = null;
                }
            }
            if (storedReport == null)
            {
                byte[] reportDefinition = m_catalog.GetReportDefinition(itemContext);
                storedReport = new StoredReport(ReportCompiler.CompileReport(itemContext, reportDefinition, GenerateExpressionHostWithRefusedPermissions, out snapshot), snapshot, GenerateExpressionHostWithRefusedPermissions);
                m_catalogTempDB.SetCompiledReport(itemContext, storedReport);
                ILocalCatalog2 localCatalog = m_catalog as ILocalCatalog2;
                foreach (DataSourceInfo dataSource in storedReport.PublishingResult.DataSources)
                {
                    string userName = null;
                    string password = null;
                    if (localCatalog != null && localCatalog.GetReportDataSourceCredentials(itemContext, dataSource, out userName, out password))
                    {
                        dataSource.SetUserName(userName, DataProtectionLocal.Instance);
                        dataSource.SetPassword(password, DataProtectionLocal.Instance);
                        dataSource.CredentialsRetrieval = DataSourceInfo.CredentialsRetrievalOption.Store;
                    }
                    else
                    {
                        if (dataSource.IsReference || dataSource.CredentialsRetrieval == DataSourceInfo.CredentialsRetrievalOption.Integrated)
                        {
                            continue;
                        }
                        if (localCatalog == null)
                        {
                            m_catalog.GetReportDataSourceCredentials(itemContext, dataSource.Name, out userName, out password);
                            bool num = !string.IsNullOrEmpty(userName);
                            if (num)
                            {
                                dataSource.SetUserName(userName, DataProtectionLocal.Instance);
                            }
                            bool flag = password != null;
                            if (flag)
                            {
                                dataSource.SetPassword(password, DataProtectionLocal.Instance);
                            }
                            if (num || flag)
                            {
                                dataSource.CredentialsRetrieval = DataSourceInfo.CredentialsRetrievalOption.Store;
                                continue;
                            }
                        }
                        if (string.IsNullOrEmpty(dataSource.Prompt))
                        {
                            dataSource.CredentialsRetrieval = DataSourceInfo.CredentialsRetrievalOption.None;
                        }
                        else
                        {
                            dataSource.CredentialsRetrieval = DataSourceInfo.CredentialsRetrievalOption.Prompt;
                        }
                    }
                }
            }
            m_securityValidator(itemContext, storedReport.PublishingResult);
            snapshot = storedReport.Snapshot;
            return(storedReport.PublishingResult);
        }