Beispiel #1
0
        public string ResolveConnectionString(ReportProcessing.ReportProcessingContext pc, out DataSourceInfo dataSourceInfo)
        {
            dataSourceInfo = null;
            string text = null;

            if (pc.DataSourceInfos != null)
            {
                if (Guid.Empty != this.ID)
                {
                    dataSourceInfo = pc.DataSourceInfos.GetByID(this.ID);
                }
                if (dataSourceInfo == null)
                {
                    dataSourceInfo = pc.DataSourceInfos.GetByName(this.Name, pc.ReportContext);
                }
                if (dataSourceInfo == null)
                {
                    throw new DataSourceNotFoundException(this.Name);
                }
                text = dataSourceInfo.GetConnectionString(pc.DataProtection);
                if (!dataSourceInfo.IsReference && text == null)
                {
                    text = this.EvaluateConnectStringExpression(pc);
                }
            }
            else
            {
                if (this.DataSourceReference != null)
                {
                    throw new DataSourceNotFoundException(this.Name);
                }
                text = this.EvaluateConnectStringExpression(pc);
            }
            return(text);
        }
Beispiel #2
0
        public string ResolveConnectionString(OnDemandProcessingContext pc, out DataSourceInfo dataSourceInfo)
        {
            dataSourceInfo = this.GetDataSourceInfo(pc);
            string text = null;

            if (dataSourceInfo != null)
            {
                text = dataSourceInfo.GetConnectionString(pc.DataProtection);
                if (!dataSourceInfo.IsReference && text == null)
                {
                    text = this.EvaluateConnectStringExpression(pc);
                }
            }
            else
            {
                text = this.EvaluateConnectStringExpression(pc);
            }
            if (DataSourceInfo.HasUseridReference(text))
            {
                pc.ReportObjectModel.UserImpl.SetConnectionStringUserProfileDependencyOrThrow();
            }
            return(text);
        }