private void SetValue(object value, bool internalSet, out bool succeeded)
 {
     succeeded = false;
     if (!internalSet)
     {
         if (!IsReportVariable || !m_variableDef.Writable)
         {
             return;
         }
         m_result = new Microsoft.ReportingServices.RdlExpressions.VariantResult(errorOccurred: false, value);
         bool flag = m_reportRT.ProcessSerializableResult(isReportScope: true, ref m_result);
         if (m_result.ErrorOccurred)
         {
             if (flag)
             {
                 ((IErrorContext)m_reportRT).Register(ProcessingErrorCode.rsVariableTypeNotSerializable, Severity.Error, m_parentObjectType, m_parentObjectName, m_variableDef.GetPropertyName(), Array.Empty <string>());
             }
         }
         else
         {
             m_reportRT.ReportObjectModel.OdpContext.StoreUpdatedVariableValue(m_indexInCollection, value);
             succeeded      = true;
             m_value        = value;
             m_isValueReady = true;
         }
     }
     else
     {
         succeeded      = true;
         m_value        = value;
         m_isValueReady = true;
     }
 }
 internal void ResetAll(Microsoft.ReportingServices.RdlExpressions.VariantResult aResult)
 {
     foreach (ReportItemImpl value in m_collection.Values)
     {
         value.Reset(aResult);
     }
 }
 private void CheckExprResultError(Microsoft.ReportingServices.RdlExpressions.VariantResult result)
 {
     if (result.ErrorOccurred)
     {
         throw new ReportProcessingException_InvalidOperationException();
     }
 }
        internal bool EvaluateParameters(out object[] values, out DataFieldStatus fieldStatus)
        {
            bool flag = false;

            fieldStatus = DataFieldStatus.None;
            values      = new object[m_aggregateDef.Expressions.Length];
            for (int i = 0; i < m_aggregateDef.Expressions.Length; i++)
            {
                try
                {
                    Microsoft.ReportingServices.RdlExpressions.VariantResult variantResult = m_reportRT.EvaluateAggregateVariantOrBinaryParamExpr(m_aggregateDef, i, this);
                    values[i] = variantResult.Value;
                    flag     |= variantResult.ErrorOccurred;
                    if (variantResult.FieldStatus != 0)
                    {
                        fieldStatus = variantResult.FieldStatus;
                    }
                }
                catch (ReportProcessingException_MissingAggregateDependency)
                {
                    if (m_aggregateDef.AggregateType == DataAggregateInfo.AggregateTypes.Previous)
                    {
                        values[i]   = null;
                        fieldStatus = DataFieldStatus.None;
                        return(false);
                    }
                    Global.Tracer.Assert(condition: false, "Unfulfilled aggregate dependency outside of a previous");
                    throw;
                }
            }
            return(flag);
        }
示例#5
0
 private object EvaluateFilterValue(Microsoft.ReportingServices.ReportIntermediateFormat.Filter filterDef)
 {
     Global.Tracer.Assert(filterDef.Values != null, "(filterDef.Values != null)");
     Global.Tracer.Assert(filterDef.Values.Count > 0, "(filterDef.Values.Count > 0)");
     Microsoft.ReportingServices.RdlExpressions.VariantResult variantResult = m_processingContext.ReportRuntime.EvaluateFilterVariantValue(filterDef, 0, m_objectType, m_objectName);
     ThrowIfErrorOccurred("FilterValue", variantResult.ErrorOccurred, variantResult.FieldStatus);
     return(variantResult.Value);
 }
 internal override object EvaluateValidValueLabelExpr(IParameterDef aParamDef, int aIndex)
 {
     Microsoft.ReportingServices.RdlExpressions.VariantResult variantResult = GetOnDemandContext().ReportRuntime.EvaluateParamValidValueLabel((Microsoft.ReportingServices.ReportIntermediateFormat.ParameterDef)aParamDef, aIndex);
     if (variantResult.ErrorOccurred)
     {
         throw new ReportProcessingException(ErrorCode.rsReportParameterProcessingError, aParamDef.Name);
     }
     return(variantResult.Value);
 }
        internal void NextRow()
        {
            long           streamOffset = m_odpContext.ReportObjectModel.FieldsImpl.StreamOffset;
            int            num          = -1;
            CommonRowCache tablixProcessingLookupRowCache = m_odpContext.TablixProcessingLookupRowCache;

            if (m_mustBufferAllRows)
            {
                num = tablixProcessingLookupRowCache.AddRow(RuntimeDataTablixObj.SaveData(m_odpContext));
                if (m_firstRowCacheIndex == -1)
                {
                    m_firstRowCacheIndex = num;
                }
            }
            IScalabilityCache tablixProcessingScalabilityCache = m_odpContext.TablixProcessingScalabilityCache;

            for (int i = 0; i < m_dataSet.LookupDestinationInfos.Count; i++)
            {
                LookupDestinationInfo lookupDestinationInfo = m_dataSet.LookupDestinationInfos[i];
                LookupObjResult       lookupObjResult       = m_dataSetInstance.LookupResults[i];
                if (lookupObjResult.ErrorOccured)
                {
                    continue;
                }
                Microsoft.ReportingServices.RdlExpressions.VariantResult variantResult = lookupDestinationInfo.EvaluateDestExpr(m_odpContext, lookupObjResult);
                if (variantResult.ErrorOccurred)
                {
                    lookupObjResult.DataFieldStatus = variantResult.FieldStatus;
                    continue;
                }
                object      value       = variantResult.Value;
                LookupTable lookupTable = lookupObjResult.GetLookupTable(m_odpContext);
                try
                {
                    if (!lookupTable.TryGetAndPinValue(value, out LookupMatches matches, out IDisposable cleanupRef))
                    {
                        matches    = ((!lookupDestinationInfo.UsedInSameDataSetTablixProcessing) ? new LookupMatches() : new LookupMatchesWithRows());
                        cleanupRef = lookupTable.AddAndPin(value, matches);
                    }
                    if (lookupDestinationInfo.IsMultiValue || !matches.HasRow)
                    {
                        matches.AddRow(streamOffset, num, tablixProcessingScalabilityCache);
                    }
                    cleanupRef.Dispose();
                }
                catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError)
                {
                    throw new ReportProcessingException(m_lookupOwner.RegisterSpatialElementComparisonError(reportProcessingException_SpatialTypeComparisonError.Type));
                }
            }
            if (!m_mustBufferAllRows)
            {
                m_lookupOwner.PostLookupNextRow();
            }
        }
 internal string GetFormattedValue(Microsoft.ReportingServices.RdlExpressions.VariantResult originalValue, IReportScopeInstance reportScopeInstance, OnDemandProcessingContext context)
 {
     context.SetupContext(InstancePath, reportScopeInstance);
     if (originalValue.ErrorOccurred)
     {
         return(RPRes.rsExpressionErrorValue);
     }
     if (originalValue.Value != null)
     {
         return(Formatter.Format(originalValue.Value, ref m_formatter, m_chart.StyleClass, m_styleClass, context, Microsoft.ReportingServices.ReportProcessing.ObjectType.Chart, m_chart.Name));
     }
     return(null);
 }
示例#9
0
        internal string FormatTextRunValue(Microsoft.ReportingServices.RdlExpressions.VariantResult textRunResult, OnDemandProcessingContext context)
        {
            string result = null;

            if (textRunResult.ErrorOccurred)
            {
                result = RPRes.rsExpressionErrorValue;
            }
            else if (textRunResult.Value != null)
            {
                result = FormatTextRunValue(textRunResult.Value, textRunResult.TypeCode, null, context);
            }
            return(result);
        }
 private void Parse()
 {
     if (m_parsed)
     {
         return;
     }
     try
     {
         m_parsed = true;
         m_paragraphDef.CriGenerationPhase = ReportElement.CriGenerationPhases.Definition;
         m_textRunDef.CriGenerationPhase   = ReportElement.CriGenerationPhases.Definition;
         ReportEnumProperty <MarkupType> markupType = m_textRunDef.MarkupType;
         MarkupType     markupType2    = (!markupType.IsExpression) ? markupType.Value : m_textRunDef.Instance.MarkupType;
         RichTextParser richTextParser = null;
         if (markupType2 != MarkupType.HTML)
         {
             return;
         }
         richTextParser = new HtmlParser(m_multipleParagraphsAllowed, this, this);
         InternalTextRunInstance internalTextRunInstance = (InternalTextRunInstance)m_textRunDef.Instance;
         Microsoft.ReportingServices.RdlExpressions.VariantResult originalValue = internalTextRunInstance.GetOriginalValue();
         if (!originalValue.ErrorOccurred && originalValue.TypeCode != 0)
         {
             try
             {
                 string richText = (originalValue.TypeCode != TypeCode.String) ? internalTextRunInstance.TextRunDef.FormatTextRunValue(originalValue.Value, originalValue.TypeCode, m_textRunDef.RenderingContext.OdpContext) : (originalValue.Value as string);
                 m_compiledParagraphCollection = (CompiledParagraphInstanceCollection)richTextParser.Parse(richText);
             }
             catch (Exception ex)
             {
                 m_errorContext.Register(ProcessingErrorCode.rsInvalidRichTextParseFailed, Severity.Warning, "TextRun", internalTextRunInstance.TextRunDef.Name, ex.Message);
                 m_parseErrorOccured         = true;
                 CreateSingleTextRun().Value = RPRes.rsRichTextParseErrorValue;
             }
         }
         else
         {
             ICompiledTextRunInstance compiledTextRunInstance = CreateSingleTextRun();
             if (originalValue.ErrorOccurred)
             {
                 compiledTextRunInstance.Value = RPRes.rsExpressionErrorValue;
             }
         }
     }
     finally
     {
         m_textRunDef.CriGenerationPhase   = ReportElement.CriGenerationPhases.None;
         m_paragraphDef.CriGenerationPhase = ReportElement.CriGenerationPhases.None;
     }
 }
示例#11
0
        internal string FormatText(Microsoft.ReportingServices.RdlExpressions.VariantResult result, OnDemandProcessingContext context)
        {
            string result2 = null;

            if (result.ErrorOccurred)
            {
                result2 = RPRes.rsExpressionErrorValue;
            }
            else if (result.Value != null)
            {
                result2 = Formatter.Format(result.Value, ref m_formatter, m_gaugePanel.StyleClass, m_styleClass, context, Microsoft.ReportingServices.ReportProcessing.ObjectType.GaugePanel, m_gaugePanel.Name);
            }
            return(result2);
        }
示例#12
0
        internal string GetFormattedStringFromValue(ref Microsoft.ReportingServices.RdlExpressions.VariantResult result, OnDemandProcessingContext context)
        {
            string result2 = null;

            if (result.ErrorOccurred)
            {
                result2 = RPRes.rsExpressionErrorValue;
            }
            else if (result.Value != null)
            {
                result2 = Formatter.Format(result.Value, ref m_formatter, base.StyleClass, null, context, ObjectType, base.Name);
            }
            return(result2);
        }
 private object GetResult(bool fromValue)
 {
     if (fromValue && !VariableInScope)
     {
         return(null);
     }
     if (!m_isValueReady)
     {
         if (m_isVisited)
         {
             ProcessingErrorCode code = IsReportVariable ? ProcessingErrorCode.rsCyclicExpressionInReportVariable : ProcessingErrorCode.rsCyclicExpressionInGroupVariable;
             ((IErrorContext)m_reportRT).Register(code, Severity.Error, m_parentObjectType, m_parentObjectName, m_variableDef.GetPropertyName(), Array.Empty <string>());
             throw new ReportProcessingException(m_reportRT.RuntimeErrorContext.Messages);
         }
         m_isVisited = true;
         bool       variableReferenceMode = m_reportRT.VariableReferenceMode;
         ObjectType objectType            = m_reportRT.ObjectType;
         string     objectName            = m_reportRT.ObjectName;
         string     propertyName          = m_reportRT.PropertyName;
         bool       unfulfilledDependency = m_reportRT.UnfulfilledDependency;
         IScope     currentScope          = m_reportRT.CurrentScope;
         m_reportRT.VariableReferenceMode = true;
         m_reportRT.UnfulfilledDependency = false;
         m_result = m_reportRT.EvaluateVariableValueExpression(m_variableDef, m_exprHost, m_parentObjectType, m_parentObjectName, IsReportVariable);
         bool unfulfilledDependency2 = m_reportRT.UnfulfilledDependency;
         m_reportRT.UnfulfilledDependency |= unfulfilledDependency;
         m_reportRT.VariableReferenceMode  = variableReferenceMode;
         m_reportRT.CurrentScope           = currentScope;
         m_reportRT.ObjectType             = objectType;
         m_reportRT.ObjectName             = objectName;
         m_reportRT.PropertyName           = propertyName;
         if (m_result.ErrorOccurred)
         {
             throw new ReportProcessingException(m_reportRT.RuntimeErrorContext.Messages);
         }
         if (unfulfilledDependency2 && fromValue)
         {
             m_value        = null;
             m_isValueReady = false;
         }
         else
         {
             m_value        = m_result.Value;
             m_isValueReady = true;
         }
         m_isVisited = false;
     }
     return(m_value);
 }
示例#14
0
 private object[] EvaluateFilterValues(Microsoft.ReportingServices.ReportIntermediateFormat.Filter filterDef)
 {
     if (filterDef.Values != null)
     {
         object[] array = new object[filterDef.Values.Count];
         for (int num = filterDef.Values.Count - 1; num >= 0; num--)
         {
             Microsoft.ReportingServices.RdlExpressions.VariantResult variantResult = m_processingContext.ReportRuntime.EvaluateFilterVariantValue(filterDef, num, m_objectType, m_objectName);
             ThrowIfErrorOccurred("FilterValues", variantResult.ErrorOccurred, variantResult.FieldStatus);
             array[num] = variantResult.Value;
         }
         return(array);
     }
     return(null);
 }
示例#15
0
        internal string EvaluateText(IReportScopeInstance reportScopeInstance, OnDemandProcessingContext context)
        {
            context.SetupContext(m_gaugePanel, reportScopeInstance);
            Microsoft.ReportingServices.RdlExpressions.VariantResult variantResult = context.ReportRuntime.EvaluateCustomLabelTextExpression(this, m_gaugePanel.Name);
            string result = null;

            if (variantResult.ErrorOccurred)
            {
                result = RPRes.rsExpressionErrorValue;
            }
            else if (variantResult.Value != null)
            {
                result = Formatter.Format(variantResult.Value, ref m_formatter, m_gaugePanel.StyleClass, m_styleClass, context, Microsoft.ReportingServices.ReportProcessing.ObjectType.GaugePanel, m_gaugePanel.Name);
            }
            return(result);
        }
        internal string EvaluateToolTip(IReportScopeInstance reportScopeInstance, OnDemandProcessingContext context)
        {
            context.SetupContext(InstancePath, reportScopeInstance);
            Microsoft.ReportingServices.RdlExpressions.VariantResult variantResult = context.ReportRuntime.EvaluateChartEmptyPointsToolTipExpression(this, m_chart.Name);
            string result = null;

            if (variantResult.ErrorOccurred)
            {
                result = RPRes.rsExpressionErrorValue;
            }
            else if (variantResult.Value != null)
            {
                result = Formatter.Format(variantResult.Value, ref m_formatter, m_chart.StyleClass, m_styleClass, context, base.ObjectType, base.Name);
            }
            return(result);
        }
示例#17
0
        internal bool CalculateDuplicates(Microsoft.ReportingServices.RdlExpressions.VariantResult currentResult, OnDemandProcessingContext context)
        {
            bool flag = false;

            if (m_hideDuplicates != null)
            {
                if (m_hasOldResult)
                {
                    if (currentResult.ErrorOccurred && m_oldResult.ErrorOccurred)
                    {
                        flag = true;
                    }
                    else if (currentResult.ErrorOccurred)
                    {
                        flag = false;
                    }
                    else if (m_oldResult.ErrorOccurred)
                    {
                        flag = false;
                    }
                    else if (currentResult.Value == null && m_oldResult.Value == null)
                    {
                        flag = true;
                    }
                    else if (currentResult.Value == null)
                    {
                        flag = false;
                    }
                    else
                    {
                        flag = (Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompareTo(currentResult.Value, m_oldResult.Value, (context.CurrentOdpDataSetInstance != null) ? context.CurrentOdpDataSetInstance.DataSetDef.NullsAsBlanks : context.NullsAsBlanks, (context.CurrentOdpDataSetInstance != null) ? context.CurrentOdpDataSetInstance.CompareInfo : context.CompareInfo, (context.CurrentOdpDataSetInstance != null) ? context.CurrentOdpDataSetInstance.ClrCompareOptions : context.ClrCompareOptions, throwExceptionOnComparisonFailure: false, extendedTypeComparisons: false, out bool validComparisonResult) == 0);
                        if (!validComparisonResult)
                        {
                            flag = false;
                        }
                    }
                }
                if (!flag)
                {
                    m_hasOldResult = true;
                    m_oldResult    = currentResult;
                }
            }
            return(flag);
        }
 private void CalculateValue()
 {
     if (m_isVisited)
     {
         m_iErrorContext.Register(ProcessingErrorCode.rsCyclicExpression, Severity.Warning, ObjectType.Field, m_fieldDef.Name, "Value");
         throw new ReportProcessingException_InvalidOperationException();
     }
     m_isVisited = true;
     Microsoft.ReportingServices.RdlExpressions.VariantResult variantResult = m_reportRT.EvaluateFieldValueExpression(m_fieldDef);
     m_value         = variantResult.Value;
     m_errorOccurred = variantResult.ErrorOccurred;
     if (m_errorOccurred)
     {
         m_exceptionMessage = variantResult.ExceptionMessage;
     }
     m_isVisited    = false;
     m_isValueReady = true;
 }
示例#19
0
 internal Microsoft.ReportingServices.RdlExpressions.VariantResult GetResult(IReportScopeInstance romInstance)
 {
     if (!m_isValueReady)
     {
         if (m_isVisited)
         {
             m_iErrorContext.Register(ProcessingErrorCode.rsCyclicExpression, Severity.Warning, m_textRunDef.ObjectType, m_textRunDef.Name, "Value");
             throw new ReportProcessingException_InvalidOperationException();
         }
         m_isVisited = true;
         ObjectType objectType   = m_reportRT.ObjectType;
         string     objectName   = m_reportRT.ObjectName;
         string     propertyName = m_reportRT.PropertyName;
         IScope     currentScope = m_reportRT.CurrentScope;
         m_reportRT.CurrentScope = m_scope;
         OnDemandProcessingContext odpContext        = m_reportRT.ReportObjectModel.OdpContext;
         ObjectModelImpl           reportObjectModel = m_reportRT.ReportObjectModel;
         try
         {
             odpContext.SetupContext(m_textBoxDef, romInstance);
             bool num = (m_textRunDef.Action != null && m_textRunDef.Action.TrackFieldsUsedInValueExpression) || (m_textBoxDef != null && m_textBoxDef.Action != null && m_textBoxDef.Action.TrackFieldsUsedInValueExpression);
             if (num)
             {
                 reportObjectModel.ResetFieldsUsedInExpression();
             }
             m_result = m_reportRT.EvaluateTextRunValueExpression(m_textRunDef);
             if (num)
             {
                 m_fieldsUsedInValueExpression = new List <string>();
                 reportObjectModel.AddFieldsUsedInExpression(m_fieldsUsedInValueExpression);
             }
         }
         finally
         {
             m_reportRT.CurrentScope = currentScope;
             m_reportRT.ObjectType   = objectType;
             m_reportRT.ObjectName   = objectName;
             m_reportRT.PropertyName = propertyName;
             m_isVisited             = false;
             m_isValueReady          = true;
         }
     }
     return(m_result);
 }
示例#20
0
        internal string GetFormattedLabelValue(Microsoft.ReportingServices.RdlExpressions.VariantResult labelObject, OnDemandProcessingContext context)
        {
            string result = null;

            if (labelObject.ErrorOccurred)
            {
                result = RPRes.rsExpressionErrorValue;
            }
            else if (labelObject.Value != null)
            {
                TypeCode typeCode = Type.GetTypeCode(labelObject.Value.GetType());
                if (m_formatter == null)
                {
                    m_formatter = new Formatter(base.DataRegionDef.StyleClass, context, Microsoft.ReportingServices.ReportProcessing.ObjectType.Chart, base.DataRegionDef.Name);
                }
                result = m_formatter.FormatValue(labelObject.Value, typeCode);
            }
            return(result);
        }
        internal Microsoft.ReportingServices.RdlExpressions.VariantResult[] EvaluateJoinConditionKeys(bool evaluatePrimaryKeys, Microsoft.ReportingServices.RdlExpressions.ReportRuntime reportRuntime)
        {
            int joinConditionCount = JoinConditionCount;

            if (joinConditionCount == 0)
            {
                return(null);
            }
            Microsoft.ReportingServices.RdlExpressions.VariantResult[] array = new Microsoft.ReportingServices.RdlExpressions.VariantResult[joinConditionCount];
            for (int i = 0; i < joinConditionCount; i++)
            {
                if (evaluatePrimaryKeys)
                {
                    array[i] = m_joinConditions[i].EvaluatePrimaryKeyExpr(reportRuntime);
                }
                else
                {
                    array[i] = m_joinConditions[i].EvaluateForeignKeyExpr(reportRuntime);
                }
            }
            return(array);
        }
示例#22
0
 internal string EvaluateCaption(IReportScopeInstance reportScopeInstance, OnDemandProcessingContext context)
 {
     context.SetupContext(m_map, reportScopeInstance);
     Microsoft.ReportingServices.RdlExpressions.VariantResult result = context.ReportRuntime.EvaluateMapLegendTitleCaptionExpression(this, m_map.Name);
     return(m_map.GetFormattedStringFromValue(ref result, context));
 }
示例#23
0
 internal override void EvaluateScopedFieldReference(string scopeName, int fieldIndex, ref Microsoft.ReportingServices.RdlExpressions.VariantResult result)
 {
     Global.Tracer.Assert(m_lastRIFObject != null, "The RIF object for the current scope should be present.");
     try
     {
         if (!m_odpContext.ReportDefinition.MappingNameToDataSet.TryGetValue(scopeName, out Microsoft.ReportingServices.ReportIntermediateFormat.DataSet value))
         {
             throw new ReportProcessingException_NonExistingScopeReference(scopeName);
         }
         if (!TryGetNonStructuralIdcDataManager(value, out NonStructuralIdcDataManager nsIdcDataManager))
         {
             nsIdcDataManager = CreateNonStructuralIdcDataManager(scopeName, value);
         }
         if (nsIdcDataManager.SourceDataScope.CurrentStreamingScopeInstance != nsIdcDataManager.LastParentScopeInstance)
         {
             nsIdcDataManager.RegisterActiveParent(nsIdcDataManager.SourceDataScope.CurrentStreamingScopeInstance);
             nsIdcDataManager.Advance();
         }
         else
         {
             nsIdcDataManager.SetupEnvironment();
         }
         m_odpContext.ReportRuntime.EvaluateSimpleFieldReference(fieldIndex, ref result);
     }
     finally
     {
         SetupEnvironment(m_lastRIFObject, m_lastOnDemandScopeInstance.Value(), m_lastOnDemandScopeInstance);
     }
 }
示例#24
0
 internal override void EvaluateScopedFieldReference(string scopeName, int fieldIndex, ref Microsoft.ReportingServices.RdlExpressions.VariantResult result)
 {
     FireAssert("EvaluateScopedFieldReference");
 }
示例#25
0
 internal Microsoft.ReportingServices.RdlExpressions.VariantResult GetResult(IReportScopeInstance romInstance, bool calledFromValue)
 {
     if (calledFromValue && !IsTextboxInScope())
     {
         m_result = default(Microsoft.ReportingServices.RdlExpressions.VariantResult);
     }
     else if (!m_isValueReady)
     {
         if (m_isVisited)
         {
             m_iErrorContext.Register(ProcessingErrorCode.rsCyclicExpression, Severity.Warning, m_textBox.ObjectType, m_textBox.Name, "Value");
             throw new ReportProcessingException_InvalidOperationException();
         }
         m_isVisited = true;
         _           = m_reportRT.ReportObjectModel;
         OnDemandProcessingContext odpContext = m_reportRT.ReportObjectModel.OdpContext;
         bool          contextUpdated         = m_reportRT.ContextUpdated;
         IInstancePath originalObject         = null;
         m_reportRT.ContextUpdated = false;
         if (odpContext.IsTablixProcessingMode || calledFromValue)
         {
             originalObject = odpContext.LastRIFObject;
         }
         bool flag = m_textBox.Action != null && m_textBox.Action.TrackFieldsUsedInValueExpression;
         Dictionary <string, bool> dictionary = null;
         if (flag)
         {
             dictionary = new Dictionary <string, bool>();
         }
         try
         {
             bool flag2 = false;
             if (m_paragraphs.Count == 1)
             {
                 TextRunsImpl textRunsImpl = (TextRunsImpl)m_paragraphs[0].TextRuns;
                 if (textRunsImpl.Count == 1)
                 {
                     flag2 = true;
                     TextRunImpl textRunImpl = (TextRunImpl)textRunsImpl[0];
                     m_result = textRunImpl.GetResult(romInstance);
                     if (flag)
                     {
                         textRunImpl.MergeFieldsUsedInValueExpression(dictionary);
                     }
                 }
             }
             if (!flag2)
             {
                 bool flag3 = false;
                 m_result = default(Microsoft.ReportingServices.RdlExpressions.VariantResult);
                 StringBuilder stringBuilder = new StringBuilder();
                 for (int i = 0; i < m_paragraphs.Count; i++)
                 {
                     if (i > 0)
                     {
                         flag3 = true;
                         stringBuilder.Append(Environment.NewLine);
                     }
                     TextRunsImpl textRunsImpl2 = (TextRunsImpl)m_paragraphs[i].TextRuns;
                     for (int j = 0; j < textRunsImpl2.Count; j++)
                     {
                         TextRunImpl textRunImpl2 = (TextRunImpl)textRunsImpl2[j];
                         Microsoft.ReportingServices.RdlExpressions.VariantResult result = textRunImpl2.GetResult(romInstance);
                         if (result.Value != null)
                         {
                             if (result.TypeCode == TypeCode.Object && (result.Value is TimeSpan || result.Value is DateTimeOffset))
                             {
                                 string text = textRunImpl2.TextRunDef.FormatTextRunValue(result, odpContext);
                                 if (text != null)
                                 {
                                     result.Value = text;
                                 }
                                 else
                                 {
                                     result.Value = Microsoft.ReportingServices.RdlExpressions.ReportRuntime.ConvertToStringFallBack(result.Value);
                                 }
                             }
                             flag3 = true;
                             stringBuilder.Append(result.Value);
                         }
                         if (flag)
                         {
                             textRunImpl2.MergeFieldsUsedInValueExpression(dictionary);
                         }
                     }
                 }
                 if (flag3)
                 {
                     m_result.Value    = stringBuilder.ToString();
                     m_result.TypeCode = TypeCode.String;
                 }
             }
             if (flag)
             {
                 m_fieldsUsedInValueExpression = new List <string>();
                 foreach (string key in dictionary.Keys)
                 {
                     m_fieldsUsedInValueExpression.Add(key);
                 }
             }
         }
         finally
         {
             odpContext.RestoreContext(originalObject);
             m_reportRT.ContextUpdated = contextUpdated;
             m_isVisited    = false;
             m_isValueReady = true;
         }
     }
     return(m_result);
 }
示例#26
0
 internal void SetResult(Microsoft.ReportingServices.RdlExpressions.VariantResult result)
 {
     m_result       = result;
     m_isValueReady = true;
 }
示例#27
0
 internal override void Reset(Microsoft.ReportingServices.RdlExpressions.VariantResult value)
 {
     SetResult(value);
 }
示例#28
0
 internal abstract void Reset(Microsoft.ReportingServices.RdlExpressions.VariantResult aResult);
示例#29
0
        internal object[] EvaluateLookup()
        {
            bool flag = m_lookupInfo.ReturnFirstMatchOnly();
            OnDemandProcessingContext odpContext = m_reportRuntime.ReportObjectModel.OdpContext;

            Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = odpContext.ReportDefinition.MappingDataSetIndexToDataSet[m_lookupInfo.DataSetIndexInCollection];
            DataSetInstance dataSetInstance = odpContext.GetDataSetInstance(dataSet);

            if (dataSetInstance == null)
            {
                throw new ReportProcessingException_InvalidOperationException();
            }
            if (dataSetInstance.NoRows)
            {
                return(EmptyResult);
            }
            if (dataSetInstance.LookupResults == null || dataSetInstance.LookupResults[m_lookupInfo.DestinationIndexInCollection] == null)
            {
                if (!odpContext.CalculateLookup(m_lookupInfo))
                {
                    return(EmptyResult);
                }
                Global.Tracer.Assert(dataSetInstance.LookupResults != null, "Lookup not initialized correctly by tablix processing");
            }
            LookupObjResult lookupObjResult = dataSetInstance.LookupResults[m_lookupInfo.DestinationIndexInCollection];

            if (lookupObjResult.ErrorOccured)
            {
                IErrorContext reportRuntime = m_reportRuntime;
                if (lookupObjResult.DataFieldStatus == DataFieldStatus.None && lookupObjResult.ErrorCode != 0)
                {
                    reportRuntime.Register(lookupObjResult.ErrorCode, lookupObjResult.ErrorSeverity, lookupObjResult.ErrorMessageArgs);
                }
                else if (lookupObjResult.DataFieldStatus == DataFieldStatus.UnSupportedDataType)
                {
                    reportRuntime.Register(ProcessingErrorCode.rsLookupOfInvalidExpressionDataType, Severity.Warning, lookupObjResult.ErrorMessageArgs);
                }
                throw new ReportProcessingException_InvalidOperationException();
            }
            Microsoft.ReportingServices.RdlExpressions.VariantResult result = m_lookupInfo.EvaluateSourceExpr(m_reportRuntime);
            CheckExprResultError(result);
            bool           flag2                         = lookupObjResult.HasBeenTransferred || odpContext.CurrentDataSetIndex != dataSet.IndexInCollection;
            List <object>  list                          = null;
            CompareInfo    compareInfo                   = null;
            CompareOptions clrCompareOptions             = CompareOptions.None;
            bool           nullsAsBlanks                 = false;
            bool           useOrdinalStringKeyGeneration = false;

            try
            {
                if (flag2)
                {
                    compareInfo                   = odpContext.CompareInfo;
                    clrCompareOptions             = odpContext.ClrCompareOptions;
                    nullsAsBlanks                 = odpContext.NullsAsBlanks;
                    useOrdinalStringKeyGeneration = odpContext.UseOrdinalStringKeyGeneration;
                    dataSetInstance.SetupCollationSettings(odpContext);
                }
                LookupTable lookupTable = lookupObjResult.GetLookupTable(odpContext);
                Global.Tracer.Assert(lookupTable != null, "LookupTable must not be null");
                ObjectModelImpl reportObjectModel = odpContext.ReportObjectModel;
                Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.ChunkManager.DataChunkReader dataChunkReader = null;
                if (flag2)
                {
                    dataChunkReader = odpContext.GetDataChunkReader(dataSet.IndexInCollection);
                }
                using (reportObjectModel.SetupNewFieldsWithBackup(dataSet, dataSetInstance, dataChunkReader))
                {
                    object[] array = result.Value as object[];
                    if (array == null)
                    {
                        array = new object[1]
                        {
                            result.Value
                        };
                    }
                    else
                    {
                        list = new List <object>(array.Length);
                    }
                    object[] array2 = array;
                    foreach (object key in array2)
                    {
                        if (lookupTable.TryGetValue(key, out LookupMatches matches))
                        {
                            int num = flag ? 1 : matches.MatchCount;
                            if (list == null)
                            {
                                list = new List <object>(num);
                            }
                            for (int j = 0; j < num; j++)
                            {
                                matches.SetupRow(j, odpContext);
                                Microsoft.ReportingServices.RdlExpressions.VariantResult result2 = m_lookupInfo.EvaluateResultExpr(m_reportRuntime);
                                CheckExprResultError(result2);
                                list.Add(result2.Value);
                            }
                        }
                    }
                }
            }
            finally
            {
                if (compareInfo != null)
                {
                    odpContext.SetComparisonInformation(compareInfo, clrCompareOptions, nullsAsBlanks, useOrdinalStringKeyGeneration);
                }
            }
            object[] result3 = EmptyResult;
            if (list != null)
            {
                result3 = list.ToArray();
            }
            return(result3);
        }
示例#30
0
        internal bool PassFilters(object dataInstance, out bool specialFilter)
        {
            bool flag = true;

            specialFilter = false;
            if (m_failFilters)
            {
                return(false);
            }
            if (m_filters != null)
            {
                for (int num = m_startFilterIndex; num < m_filters.Count; num++)
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.Filter filter = m_filters[num];
                    if (Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.Like == filter.Operator)
                    {
                        Microsoft.ReportingServices.RdlExpressions.StringResult stringResult = m_processingContext.ReportRuntime.EvaluateFilterStringExpression(filter, m_objectType, m_objectName);
                        ThrowIfErrorOccurred("FilterExpression", stringResult.ErrorOccurred, stringResult.FieldStatus);
                        Global.Tracer.Assert(filter.Values != null, "(null != filter.Values)");
                        Global.Tracer.Assert(1 <= filter.Values.Count, "(1 <= filter.Values.Count)");
                        Microsoft.ReportingServices.RdlExpressions.StringResult stringResult2 = m_processingContext.ReportRuntime.EvaluateFilterStringValue(filter, 0, m_objectType, m_objectName);
                        ThrowIfErrorOccurred("FilterValue", stringResult2.ErrorOccurred, stringResult2.FieldStatus);
                        if (stringResult.Value != null && stringResult2.Value != null)
                        {
                            if (!StringType.StrLikeText(stringResult.Value, stringResult2.Value))
                            {
                                flag = false;
                            }
                        }
                        else if (stringResult.Value != null || stringResult2.Value != null)
                        {
                            flag = false;
                        }
                    }
                    else
                    {
                        Microsoft.ReportingServices.RdlExpressions.VariantResult variantResult = m_processingContext.ReportRuntime.EvaluateFilterVariantExpression(filter, m_objectType, m_objectName);
                        ThrowIfErrorOccurred("FilterExpression", variantResult.ErrorOccurred, variantResult.FieldStatus);
                        object value = variantResult.Value;
                        if (filter.Operator == Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.Equal || Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.NotEqual == filter.Operator || Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.GreaterThan == filter.Operator || Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.GreaterThanOrEqual == filter.Operator || Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.LessThan == filter.Operator || Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.LessThanOrEqual == filter.Operator)
                        {
                            object value2 = EvaluateFilterValue(filter);
                            int    num2   = 0;
                            try
                            {
                                num2 = Compare(value, value2);
                            }
                            catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError)
                            {
                                throw new ReportProcessingException(RegisterSpatialTypeComparisonError(reportProcessingException_SpatialTypeComparisonError.Type));
                            }
                            catch (ReportProcessingException_ComparisonError e)
                            {
                                throw new ReportProcessingException(RegisterComparisonError(e));
                            }
                            catch (Exception e2)
                            {
                                if (AsynchronousExceptionDetection.IsStoppingException(e2))
                                {
                                    throw;
                                }
                                throw new ReportProcessingException(RegisterComparisonError());
                            }
                            if (flag)
                            {
                                switch (filter.Operator)
                                {
                                case Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.Equal:
                                    if (num2 != 0)
                                    {
                                        flag = false;
                                    }
                                    break;

                                case Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.NotEqual:
                                    if (num2 == 0)
                                    {
                                        flag = false;
                                    }
                                    break;

                                case Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.GreaterThan:
                                    if (0 >= num2)
                                    {
                                        flag = false;
                                    }
                                    break;

                                case Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.GreaterThanOrEqual:
                                    if (0 > num2)
                                    {
                                        flag = false;
                                    }
                                    break;

                                case Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.LessThan:
                                    if (0 <= num2)
                                    {
                                        flag = false;
                                    }
                                    break;

                                case Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.LessThanOrEqual:
                                    if (0 < num2)
                                    {
                                        flag = false;
                                    }
                                    break;
                                }
                            }
                        }
                        else if (Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.In == filter.Operator)
                        {
                            object[] array = EvaluateFilterValues(filter);
                            flag = false;
                            if (array != null)
                            {
                                for (int i = 0; i < array.Length; i++)
                                {
                                    try
                                    {
                                        if (array[i] is ICollection)
                                        {
                                            foreach (object item in (ICollection)array[i])
                                            {
                                                if (Compare(value, item) == 0)
                                                {
                                                    flag = true;
                                                    break;
                                                }
                                            }
                                        }
                                        else if (Compare(value, array[i]) == 0)
                                        {
                                            flag = true;
                                        }
                                        if (flag)
                                        {
                                            goto IL_05e1;
                                        }
                                    }
                                    catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError2)
                                    {
                                        throw new ReportProcessingException(RegisterSpatialTypeComparisonError(reportProcessingException_SpatialTypeComparisonError2.Type));
                                    }
                                    catch (ReportProcessingException_ComparisonError e3)
                                    {
                                        throw new ReportProcessingException(RegisterComparisonError(e3));
                                    }
                                    catch (Exception e4)
                                    {
                                        if (AsynchronousExceptionDetection.IsStoppingException(e4))
                                        {
                                            throw;
                                        }
                                        throw new ReportProcessingException(RegisterComparisonError());
                                    }
                                }
                            }
                        }
                        else if (Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.Between == filter.Operator)
                        {
                            object[] array2 = EvaluateFilterValues(filter);
                            flag = false;
                            Global.Tracer.Assert(array2 != null && 2 == array2.Length, "(null != values && 2 == values.Length)");
                            try
                            {
                                if (0 <= Compare(value, array2[0]) && 0 >= Compare(value, array2[1]))
                                {
                                    flag = true;
                                }
                            }
                            catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError3)
                            {
                                throw new ReportProcessingException(RegisterSpatialTypeComparisonError(reportProcessingException_SpatialTypeComparisonError3.Type));
                            }
                            catch (ReportProcessingException_ComparisonError e5)
                            {
                                throw new ReportProcessingException(RegisterComparisonError(e5));
                            }
                            catch (RSException)
                            {
                                throw;
                            }
                            catch (Exception e6)
                            {
                                if (AsynchronousExceptionDetection.IsStoppingException(e6))
                                {
                                    throw;
                                }
                                throw new ReportProcessingException(RegisterComparisonError());
                            }
                        }
                        else if (Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.TopN == filter.Operator || Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.BottomN == filter.Operator)
                        {
                            if (m_filterInfo == null)
                            {
                                Global.Tracer.Assert(filter.Values != null && 1 == filter.Values.Count, "(null != filter.Values && 1 == filter.Values.Count)");
                                Microsoft.ReportingServices.RdlExpressions.IntegerResult integerResult = m_processingContext.ReportRuntime.EvaluateFilterIntegerValue(filter, 0, m_objectType, m_objectName);
                                ThrowIfErrorOccurred("FilterValue", integerResult.ErrorOccurred, integerResult.FieldStatus);
                                int       value3   = integerResult.Value;
                                IComparer comparer = (Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.TopN != filter.Operator) ? ((IComparer) new MyBottomComparer(m_processingContext.ProcessingComparer)) : ((IComparer) new MyTopComparer(m_processingContext.ProcessingComparer));
                                InitFilterInfos(new MySortedListWithMaxSize(comparer, value3, this), num);
                            }
                            SortAndSave(value, dataInstance);
                            flag          = false;
                            specialFilter = true;
                        }
                        else if (Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.TopPercent == filter.Operator || Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.BottomPercent == filter.Operator)
                        {
                            if (m_filterInfo == null)
                            {
                                Global.Tracer.Assert(filter.Values != null && 1 == filter.Values.Count, "(null != filter.Values && 1 == filter.Values.Count)");
                                Microsoft.ReportingServices.RdlExpressions.FloatResult floatResult = m_processingContext.ReportRuntime.EvaluateFilterIntegerOrFloatValue(filter, 0, m_objectType, m_objectName);
                                ThrowIfErrorOccurred("FilterValue", floatResult.ErrorOccurred, floatResult.FieldStatus);
                                double    value4    = floatResult.Value;
                                IComparer comparer2 = (Microsoft.ReportingServices.ReportIntermediateFormat.Filter.Operators.TopPercent != filter.Operator) ? ((IComparer) new MyBottomComparer(m_processingContext.ProcessingComparer)) : ((IComparer) new MyTopComparer(m_processingContext.ProcessingComparer));
                                InitFilterInfos(new MySortedListWithoutMaxSize(comparer2, this), num);
                                m_filterInfo.Percentage = value4;
                                m_filterInfo.Operator   = filter.Operator;
                            }
                            SortAndSave(value, dataInstance);
                            flag          = false;
                            specialFilter = true;
                        }
                    }
                    goto IL_05e1;
IL_05e1:
                    if (!flag)
                    {
                        return(false);
                    }
                }
            }
            return(flag);
        }