internal override void SetupExprHost(IParameterDef aParamDef) { Microsoft.ReportingServices.ReportProcessing.ReportProcessing.ReportProcessingContext legacyContext = GetLegacyContext(); if (legacyContext.ReportRuntime.ReportExprHost != null) { ((ParameterDef)aParamDef).SetExprHost(legacyContext.ReportRuntime.ReportExprHost, legacyContext.ReportObjectModel); } }
public override void SetupExprHost(IParameterDef aParamDef) { AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportProcessingContext legacyContext = this.GetLegacyContext(); if (legacyContext.ReportRuntime.ReportExprHost != null) { ((ParameterDef)aParamDef).SetExprHost(legacyContext.ReportRuntime.ReportExprHost, legacyContext.ReportObjectModel); } }
public bool ValidateValue(object newValue, IParameterDef paramDef, string parameterValueProperty) { if (paramDef.ValidateValueForNull(newValue, this.m_processingContext.ErrorContext, parameterValueProperty) && paramDef.ValidateValueForBlank(newValue, this.m_processingContext.ErrorContext, parameterValueProperty)) { return(true); } return(false); }
public override object EvaluateValidValueLabelExpr(IParameterDef aParamDef, int aIndex) { AspNetCore.ReportingServices.RdlExpressions.VariantResult variantResult = this.GetOnDemandContext().ReportRuntime.EvaluateParamValidValueLabel((AspNetCore.ReportingServices.ReportIntermediateFormat.ParameterDef)aParamDef, aIndex); if (variantResult.ErrorOccurred) { throw new ReportProcessingException(ErrorCode.rsReportParameterProcessingError, aParamDef.Name); } return(variantResult.Value); }
public override void SetupExprHost(IParameterDef aParamDef) { OnDemandProcessingContext onDemandContext = this.GetOnDemandContext(); if (onDemandContext.ReportRuntime.ReportExprHost != null) { ((AspNetCore.ReportingServices.ReportIntermediateFormat.ParameterDef)aParamDef).SetExprHost(onDemandContext.ReportRuntime.ReportExprHost, onDemandContext.ReportObjectModel); } }
internal override object EvaluateDefaultValueExpr(IParameterDef aParamDef, int aIndex) { Microsoft.ReportingServices.RdlExpressions.VariantResult variantResult = GetOnDemandContext().ReportRuntime.EvaluateParamDefaultValue((Microsoft.ReportingServices.ReportIntermediateFormat.ParameterDef)aParamDef, aIndex); if (variantResult.ErrorOccurred) { throw new ReportProcessingException(ErrorCode.rsReportParameterProcessingError, aParamDef.Name); } return(variantResult.Value); }
public override object EvaluateValidValueExpr(IParameterDef aParamDef, int aIndex) { VariantResult variantResult = this.GetLegacyContext().ReportRuntime.EvaluateParamValidValue((ParameterDef)aParamDef, aIndex); if (variantResult.ErrorOccurred) { throw new ReportProcessingException(ErrorCode.rsReportParameterProcessingError, aParamDef.Name); } return(variantResult.Value); }
internal void ConvertAndAddValidValue(ParameterInfo parameter, IParameterDef paramDef, object value, object label) { value = ConvertValue(value, paramDef, isDefaultValue: false); string value2 = label as string; value2 = ApplySandboxStringRestriction(value2, paramDef.Name, "Label"); if (ValidateValue(value, paramDef, "ValidValues")) { parameter.AddValidValue(value, value2); } }
public void ConvertAndAddValidValue(ParameterInfo parameter, IParameterDef paramDef, object value, object label) { value = this.ConvertValue(value, paramDef, false); string value2 = label as string; value2 = this.ApplySandboxStringRestriction(value2, paramDef.Name, "Label"); if (this.ValidateValue(value, paramDef, "ValidValues")) { parameter.AddValidValue(value, value2); } }
internal ReportParameterDataSetCache(ProcessReportParameters aParamProcessor, ParameterInfo aParameter, IParameterDef aParamDef, bool aProcessValidValues, bool aProcessDefaultValues) { m_paramProcessor = aParamProcessor; m_parameter = aParameter; m_parameterDef = aParamDef; m_processDefaultValues = aProcessDefaultValues; m_processValidValues = aProcessValidValues; if (m_processDefaultValues) { m_defaultValues = new List <object>(); } if (m_processValidValues) { m_parameter.ValidValues = new ValidValueList(); } }
public override ReportParameterDataSetCache ProcessReportParameterDataSet(ParameterInfo aParam, IParameterDef aParamDef, IParameterDataSource paramDS, bool aRetrieveValidValues, bool aRetrievalDefaultValues) { ReportParameterDataSetCache reportParameterDataSetCache = new OnDemandReportParameterDataSetCache(this, aParam, (AspNetCore.ReportingServices.ReportIntermediateFormat.ParameterDef)aParamDef, aRetrieveValidValues, aRetrievalDefaultValues); RetrievalManager retrievalManager = new RetrievalManager(this.m_report, this.GetOnDemandContext()); retrievalManager.FetchParameterData(reportParameterDataSetCache, paramDS.DataSourceIndex, paramDS.DataSetIndex); return(reportParameterDataSetCache); }
public override string EvaluatePromptExpr(ParameterInfo aParamInfo, IParameterDef aParamDef) { Global.Tracer.Assert(false); return(null); }
public override string EvaluatePromptExpr(ParameterInfo aParamInfo, IParameterDef aParamDef) { return(this.GetOnDemandContext().ReportRuntime.EvaluateParamPrompt((AspNetCore.ReportingServices.ReportIntermediateFormat.ParameterDef)aParamDef)); }
public override ReportParameterDataSetCache ProcessReportParameterDataSet(ParameterInfo aParam, IParameterDef aParamDef, IParameterDataSource paramDS, bool aRetrieveValidValues, bool aRetrievalDefaultValues) { EventHandler eventHandler = null; LegacyReportParameterDataSetCache legacyReportParameterDataSetCache = new LegacyReportParameterDataSetCache(this, aParam, (ParameterDef)aParamDef, aRetrieveValidValues, aRetrievalDefaultValues); AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportProcessingContext legacyContext = this.GetLegacyContext(); try { this.m_runtimeDataSourceNode = new AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.ReportRuntimeDataSourceNode(this.m_report, this.m_report.DataSources[paramDS.DataSourceIndex], paramDS.DataSetIndex, legacyContext, legacyReportParameterDataSetCache); eventHandler = this.AbortHandler; legacyContext.AbortInfo.ProcessingAbortEvent += eventHandler; if (Global.Tracer.TraceVerbose) { Global.Tracer.Trace(TraceLevel.Verbose, "Abort handler registered."); } this.m_runtimeDataSourceNode.InitProcessingParams(false, true); this.m_runtimeDataSourceNode.ProcessConcurrent(null); legacyContext.CheckAndThrowIfAborted(); AspNetCore.ReportingServices.ReportProcessing.ReportProcessing.RuntimeDataSetNode runtimeDataSetNode = this.m_runtimeDataSourceNode.RuntimeDataSetNodes[0]; return(legacyReportParameterDataSetCache); } finally { if (eventHandler != null) { legacyContext.AbortInfo.ProcessingAbortEvent -= eventHandler; } if (this.m_runtimeDataSourceNode != null) { this.m_runtimeDataSourceNode.Cleanup(); } } }
public abstract void SetupExprHost(IParameterDef aParamDef);
internal override void SetupExprHost(IParameterDef aParamDef) { }
public bool ProcessDefaultValue(ParameterInfo parameter, IParameterDef paramDef) { if (parameter != null && paramDef != null) { object obj = null; if (paramDef.HasDefaultValuesExpressions()) { int num = paramDef.DefaultValuesExpressionCount; Global.Tracer.Assert(0 != num, "(0 != count)"); if (!paramDef.MultiValue) { num = 1; } this.SetupExprHost(paramDef); ArrayList arrayList = new ArrayList(num); for (int i = 0; i < num; i++) { obj = this.EvaluateDefaultValueExpr(paramDef, i); if (obj is object[]) { object[] array = obj as object[]; foreach (object o in array) { object obj2 = this.ConvertValue(o, paramDef, true); if (!this.ValidateValue(obj2, paramDef, "DefaultValue")) { return(true); } arrayList.Add(obj2); } continue; } obj = this.ConvertValue(obj, paramDef, true); if (!this.ValidateValue(obj, paramDef, "DefaultValue")) { return(true); } arrayList.Add(obj); } Global.Tracer.Assert(null != arrayList, "(null != defaultValues)"); if (paramDef.MultiValue) { parameter.DefaultValues = new object[arrayList.Count]; arrayList.CopyTo(parameter.DefaultValues); } else if (arrayList.Count > 0) { parameter.DefaultValues = new object[1]; parameter.DefaultValues[0] = arrayList[0]; } else { parameter.DefaultValues = new object[0]; } } else if (paramDef.HasDefaultValuesDataSource() && this.m_processingContext.EnableDataBackedParameters) { IParameterDataSource defaultDataSource = paramDef.DefaultDataSource; IParameterDataSource validValuesDataSource = paramDef.ValidValuesDataSource; List <object> list = null; if (this.m_paramDataSetCache != null && validValuesDataSource != null && defaultDataSource.DataSourceIndex == validValuesDataSource.DataSourceIndex && defaultDataSource.DataSetIndex == validValuesDataSource.DataSetIndex) { list = this.m_paramDataSetCache.DefaultValues; } else { if (this.NeedPrompt(defaultDataSource)) { parameter.MissingUpstreamDataSourcePrompt = true; return(false); } ReportParameterDataSetCache reportParameterDataSetCache = this.ProcessReportParameterDataSet(parameter, paramDef, defaultDataSource, false, true); list = reportParameterDataSetCache.DefaultValues; if (Global.Tracer.TraceVerbose && (list == null || list.Count == 0)) { Global.Tracer.Trace(TraceLevel.Verbose, "Parameter '{0}' default value list does not contain any values.", parameter.Name.MarkAsPrivate()); } } if (list != null) { int count = list.Count; parameter.DefaultValues = new object[count]; int num2 = 0; while (num2 < count) { obj = list[num2]; if (this.ValidateValue(obj, paramDef, "DefaultValue")) { parameter.DefaultValues[num2] = obj; num2++; continue; } if (Global.Tracer.TraceVerbose) { Global.Tracer.Trace(TraceLevel.Verbose, "Parameter '{0}' has a default value '{1}' which is not a valid value.", parameter.Name.MarkAsPrivate(), obj.ToString().MarkAsPrivate()); } parameter.DefaultValues = null; return(true); } } } return(true); } return(true); }
public abstract ReportParameterDataSetCache ProcessReportParameterDataSet(ParameterInfo aParam, IParameterDef aParamDef, IParameterDataSource paramDS, bool aRetrieveValidValues, bool aRetrievalDefaultValues);
internal override object EvaluateValidValueLabelExpr(IParameterDef aParamDef, int aIndex) { throw new NotSupportedException(); }
public abstract string EvaluatePromptExpr(ParameterInfo aParamInfo, IParameterDef aParamDef);
public abstract object EvaluateValidValueLabelExpr(IParameterDef aParamDef, int aIndex);
public abstract object EvaluateDefaultValueExpr(IParameterDef aParamDef, int aIndex);
internal override ReportParameterDataSetCache ProcessReportParameterDataSet(ParameterInfo aParam, IParameterDef aParamDef, IParameterDataSource paramDS, bool aRetrieveValidValues, bool aRetrievalDefaultValues) { throw new NotSupportedException(); }
public bool ProcessValidValues(ParameterInfo parameter, IParameterDef paramDef, bool aEvaluateDefaultValues) { if (parameter != null && paramDef != null) { IParameterDataSource validValuesDataSource = paramDef.ValidValuesDataSource; if (paramDef.HasValidValuesDataSource()) { if (this.m_processingContext.EnableDataBackedParameters) { if (this.NeedPrompt(validValuesDataSource)) { parameter.MissingUpstreamDataSourcePrompt = true; return(false); } IParameterDataSource defaultDataSource = paramDef.DefaultDataSource; bool aRetrievalDefaultValues = aEvaluateDefaultValues && defaultDataSource != null && defaultDataSource.DataSourceIndex == validValuesDataSource.DataSourceIndex && defaultDataSource.DataSetIndex == validValuesDataSource.DataSetIndex; this.m_paramDataSetCache = this.ProcessReportParameterDataSet(parameter, paramDef, validValuesDataSource, true, aRetrievalDefaultValues); if (Global.Tracer.TraceVerbose && parameter.ValidValues != null && parameter.ValidValues.Count == 0) { Global.Tracer.Trace(TraceLevel.Verbose, "Parameter '{0}' dynamic valid value list does not contain any values.", parameter.Name.MarkAsPrivate()); } } } else if (paramDef.HasValidValuesValueExpressions()) { int validValuesValueExpressionCount = paramDef.ValidValuesValueExpressionCount; Global.Tracer.Assert(0 != validValuesValueExpressionCount, "(0 != count)"); Global.Tracer.Assert(paramDef.HasValidValuesLabelExpressions() && validValuesValueExpressionCount == paramDef.ValidValuesLabelExpressionCount); this.SetupExprHost(paramDef); parameter.ValidValues = new ValidValueList(validValuesValueExpressionCount); for (int i = 0; i < validValuesValueExpressionCount; i++) { object obj = this.EvaluateValidValueExpr(paramDef, i); object obj2 = this.EvaluateValidValueLabelExpr(paramDef, i); bool flag = obj is object[]; bool flag2 = obj2 is object[]; if (flag && (flag2 || obj2 == null)) { object[] array = obj as object[]; object[] array2 = obj2 as object[]; if (array2 != null && array.Length != array2.Length) { this.m_processingContext.ErrorContext.Register(ProcessingErrorCode.rsInvalidValidValueList, Severity.Error, ObjectType.ReportParameter, paramDef.Name, "ValidValues"); throw new ReportProcessingException(this.m_processingContext.ErrorContext.Messages); } int num = array.Length; for (int j = 0; j < num; j++) { obj2 = ((array2 == null) ? null : array2[j]); this.ConvertAndAddValidValue(parameter, paramDef, array[j], obj2); } continue; } if (!flag && (!flag2 || obj2 == null)) { this.ConvertAndAddValidValue(parameter, paramDef, obj, obj2); continue; } this.m_processingContext.ErrorContext.Register(ProcessingErrorCode.rsInvalidValidValueList, Severity.Error, ObjectType.ReportParameter, paramDef.Name, "ValidValues"); throw new ReportProcessingException(this.m_processingContext.ErrorContext.Messages); } } return(true); } return(true); }
protected override void AssertAreSameParameterByName(ParameterInfo paramInfo, IParameterDef paramDef) { DataSetParameterValue dataSetParameterValue = (DataSetParameterValue)paramDef; Global.Tracer.Assert(string.Compare(paramInfo.Name, dataSetParameterValue.UniqueName, StringComparison.OrdinalIgnoreCase) == 0, "paramInfo.Name == dataSetParamDef.UniqueName, parameter {0}", paramInfo.Name.MarkAsPrivate()); }
private void ProcessParameter(ParameterInfoCollection aParameters, int aParamIndex) { ParameterInfo parameterInfo = aParameters[aParamIndex]; parameterInfo.MissingUpstreamDataSourcePrompt = false; IParameterDef parameterDef = null; bool flag = aParameters.UserProfileState != UserProfileState.None; if (this.m_processingContext.SnapshotProcessing && parameterInfo.UsedInQuery) { parameterInfo.State = ReportParameterState.HasValidValue; parameterInfo.StoreLabels(); } else { if (parameterInfo.DynamicDefaultValue || parameterInfo.DynamicValidValues || parameterInfo.DynamicPrompt) { this.UpdateParametersContext(aParameters, this.m_lastDynamicParam, aParamIndex); this.m_lastDynamicParam = aParamIndex; parameterDef = this.GetParameterDef(aParamIndex); Global.Tracer.Assert(null != parameterDef, "null != paramDef, parameter {0}", parameterInfo.Name.MarkAsPrivate()); Global.Tracer.Assert(parameterInfo.DataType == parameterDef.DataType, "paramInfo.DataType == paramDef.DataType, parameter {0}", parameterInfo.Name.MarkAsPrivate()); this.AssertAreSameParameterByName(parameterInfo, parameterDef); } bool flag2 = this.m_dependenciesSubmitted.ContainsKey(parameterInfo.Name); if (parameterInfo.DynamicPrompt && (flag2 || !parameterInfo.IsUserSupplied || flag)) { this.SetupExprHost(parameterDef); string text = this.EvaluatePromptExpr(parameterInfo, parameterDef); if (text == null || text.Equals(string.Empty)) { text = parameterInfo.Name; } parameterInfo.Prompt = text; } switch (parameterInfo.CalculateDependencyStatus()) { case ReportParameterDependencyState.HasOutstandingDependencies: parameterInfo.State = ReportParameterState.HasOutstandingDependencies; parameterInfo.Values = null; if (parameterInfo.DynamicDefaultValue) { parameterInfo.DefaultValues = null; } if (parameterInfo.DynamicValidValues) { parameterInfo.ValidValues = null; } return; case ReportParameterDependencyState.MissingUpstreamDataSourcePrompt: parameterInfo.MissingUpstreamDataSourcePrompt = true; parameterInfo.State = ReportParameterState.DynamicValuesUnavailable; return; default: Global.Tracer.Assert(false, "Unexpected dependency state."); break; case ReportParameterDependencyState.AllDependenciesSpecified: break; } bool flag3 = parameterInfo.DynamicDefaultValue && (parameterInfo.Values == null || (parameterInfo.Values != null && !parameterInfo.IsUserSupplied)) && ((this.m_processingContext.SnapshotProcessing && parameterDef.HasDefaultValuesExpressions() && (flag || (parameterInfo.DependencyList != null && (parameterInfo.Values == null || (!parameterInfo.IsUserSupplied && flag2))))) || (!this.m_processingContext.SnapshotProcessing && (flag2 || parameterInfo.Values == null))); if (parameterInfo.DynamicValidValues && ((this.m_processingContext.SnapshotProcessing && parameterDef.HasValidValuesValueExpressions() && (parameterInfo.DependencyList != null || (flag && flag3))) || (!this.m_processingContext.SnapshotProcessing && ((parameterInfo.ValidValues != null && flag2) || parameterInfo.ValidValues == null))) && !this.ProcessValidValues(parameterInfo, parameterDef, flag3)) { parameterInfo.State = ReportParameterState.DynamicValuesUnavailable; } else if (!flag3 && parameterInfo.Values != null) { if (parameterInfo.ValueIsValid()) { parameterInfo.State = ReportParameterState.HasValidValue; parameterInfo.StoreLabels(); } else { parameterInfo.State = ReportParameterState.InvalidValueProvided; parameterInfo.Values = null; parameterInfo.EnsureLabelsAreGenerated(); } } else { parameterInfo.Values = null; parameterInfo.State = ReportParameterState.MissingValidValue; if (flag3 && !this.ProcessDefaultValue(parameterInfo, parameterDef)) { parameterInfo.State = ReportParameterState.DynamicValuesUnavailable; } else { if (parameterInfo.DefaultValues != null) { parameterInfo.Values = parameterInfo.DefaultValues; if (!parameterInfo.ValueIsValid()) { parameterInfo.Values = null; parameterInfo.State = ReportParameterState.DefaultValueInvalid; parameterInfo.EnsureLabelsAreGenerated(); } else { parameterInfo.State = ReportParameterState.HasValidValue; parameterInfo.StoreLabels(); } } this.m_paramDataSetCache = null; } } } }
internal override object EvaluateDefaultValueExpr(IParameterDef aParamDef, int aIndex) { return((aParamDef as DataSetParameterValue).EvaluateQueryParameterValue(GetOnDemandContext(), m_dataSetCore.ExprHost)); }
protected virtual void AssertAreSameParameterByName(ParameterInfo paramInfo, IParameterDef paramDef) { Global.Tracer.Assert(0 == string.Compare(paramInfo.Name, paramDef.Name, StringComparison.OrdinalIgnoreCase), "paramInfo.Name == paramDef.Name, parameter {0}", paramInfo.Name.MarkAsPrivate()); }
internal override string EvaluatePromptExpr(ParameterInfo aParamInfo, IParameterDef aParamDef) { throw new NotSupportedException(); }
public object ConvertValue(object o, IParameterDef paramDef, bool isDefaultValue) { if (o != null && DBNull.Value != o) { bool flag = false; object obj = null; try { DataType dataType = paramDef.DataType; if (dataType <= DataType.Integer) { switch (dataType) { case DataType.Object: obj = o; return(obj); case DataType.Boolean: obj = (bool)o; return(obj); case DataType.Integer: obj = Convert.ToInt32(o, Thread.CurrentThread.CurrentCulture); return(obj); default: return(obj); case (DataType)2: return(obj); } } switch (dataType) { case DataType.DateTime: if (o is DateTimeOffset) { obj = (DateTimeOffset)o; return(obj); } obj = (DateTime)o; return(obj); case DataType.Float: obj = Convert.ToDouble(o, Thread.CurrentThread.CurrentCulture); return(obj); case DataType.String: obj = Convert.ToString(o, Thread.CurrentThread.CurrentCulture); obj = this.ApplySandboxStringRestriction((string)obj, paramDef.Name, isDefaultValue ? "DefaultValue" : "ValidValue"); return(obj); default: return(obj); case (DataType)17: return(obj); } } catch (InvalidCastException) { flag = true; return(obj); } catch (OverflowException) { flag = true; return(obj); } catch (FormatException) { flag = true; return(obj); } finally { if (flag) { string propertyName = (!isDefaultValue) ? "ValidValues" : "DefaultValue"; this.m_processingContext.ErrorContext.Register(ProcessingErrorCode.rsParameterPropertyTypeMismatch, Severity.Error, paramDef.ParameterObjectType, paramDef.Name, propertyName); throw new ReportProcessingException(this.m_processingContext.ErrorContext.Messages); } } } return(null); }