private static void ValidateBackgroundImage(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageSource, Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageValue, Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageMIMEType, Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundEmbeddingMode, Microsoft.ReportingServices.ReportIntermediateFormat.Style style, ObjectType objectType, string objectName, ErrorContext errorContext)
        {
            if (backgroundImageSource == null)
            {
                return;
            }
            bool flag = true;

            Global.Tracer.Assert(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == backgroundImageSource.Type);
            Microsoft.ReportingServices.OnDemandReportRendering.Image.SourceType intValue = (Microsoft.ReportingServices.OnDemandReportRendering.Image.SourceType)backgroundImageSource.IntValue;
            Global.Tracer.Assert(backgroundImageValue != null);
            if (Microsoft.ReportingServices.OnDemandReportRendering.Image.SourceType.Database == intValue && Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == backgroundImageValue.Type)
            {
                errorContext.Register(ProcessingErrorCode.rsBinaryConstant, Severity.Error, objectType, objectName, "BackgroundImageValue");
                flag = false;
            }
            if (Microsoft.ReportingServices.OnDemandReportRendering.Image.SourceType.Database == intValue && !ValidateMimeType(backgroundImageMIMEType, objectType, objectName, "BackgroundImageMIMEType", errorContext))
            {
                flag = false;
            }
            if (flag)
            {
                style.AddAttribute("BackgroundImageSource", backgroundImageSource);
                style.AddAttribute("BackgroundImageValue", backgroundImageValue);
                if (backgroundEmbeddingMode != null)
                {
                    style.AddAttribute("EmbeddingMode", backgroundEmbeddingMode);
                }
                if (Microsoft.ReportingServices.OnDemandReportRendering.Image.SourceType.Database == intValue)
                {
                    style.AddAttribute("BackgroundImageMIMEType", backgroundImageMIMEType);
                }
            }
        }
 internal static void AddGroupNameValuePair(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.Grouping grouping, Dictionary <string, object> nameValuePairs)
 {
     if (grouping == null)
     {
         return;
     }
     Global.Tracer.Assert(grouping.GroupExpressions != null && 0 < grouping.GroupExpressions.Count);
     Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = grouping.GroupExpressions[0];
     if (expressionInfo.Type != Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Field)
     {
         return;
     }
     try
     {
         FieldImpl fieldImpl = odpContext.ReportObjectModel.FieldsImpl[expressionInfo.IntValue];
         if (fieldImpl.FieldDef != null)
         {
             object value = fieldImpl.Value;
             if (!nameValuePairs.ContainsKey(fieldImpl.FieldDef.DataField))
             {
                 nameValuePairs.Add(fieldImpl.FieldDef.DataField, (value is DBNull) ? null : value);
             }
         }
     }
     catch (Exception e)
     {
         if (AsynchronousExceptionDetection.IsStoppingException(e))
         {
             throw;
         }
     }
 }
예제 #3
0
 private void ProcessAggregateParam(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expression, ExpressionParser.ExpressionContext context)
 {
     if (expression != null && expression.Type == Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Expression)
     {
         RegisterExpression(new ExprCompileTimeInfo(expression, context));
     }
 }
 internal ReportBoolProperty(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expression, bool value)
     : base(expression?.IsExpression ?? false, expression?.OriginalText)
 {
     if (expression != null && !expression.IsExpression)
     {
         m_value = value;
     }
 }
예제 #5
0
        internal CustomProperty Add(RenderingContext renderingContext, Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo nameExpr, Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo valueExpr)
        {
            CustomProperty customProperty = new CustomProperty(m_reportElementOwner, renderingContext, nameExpr, valueExpr, null, null, TypeCode.Empty);

            Global.Tracer.Assert(customProperty.Instance != null, "prop.Instance != null");
            m_list.Add(customProperty);
            return(customProperty);
        }
 internal bool IsRestrictedNaturalGroupSort(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo)
 {
     if (expressionInfo.Type != Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Field)
     {
         return(m_publishingVersioning.IsRdlFeatureRestricted(RdlFeatures.SortGroupExpression_OnlySimpleField));
     }
     return(false);
 }
 internal static bool ValidateEmbeddedImageName(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo embeddedImageName, Dictionary <string, Microsoft.ReportingServices.ReportIntermediateFormat.ImageInfo> embeddedImages, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(embeddedImageName != null);
     if (Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == embeddedImageName.Type)
     {
         return(ValidateEmbeddedImageName(embeddedImageName.StringValue, embeddedImages, objectType, objectName, propertyName, errorContext));
     }
     return(true);
 }
예제 #8
0
 internal ExprCompileTimeInfo(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expression, ExpressionParser.ExpressionContext context)
 {
     ExpressionInfo    = expression;
     OwnerObjectType   = context.ObjectType;
     OwnerObjectName   = context.ObjectName;
     OwnerPropertyName = context.PropertyName;
     NumErrors         = 0;
     NumWarnings       = 0;
 }
 private static bool ValidateNumeralVariant(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo numeralVariant, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(numeralVariant != null);
     if (Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == numeralVariant.Type && !Validator.ValidateNumeralVariant(numeralVariant.IntValue))
     {
         errorContext.Register(ProcessingErrorCode.rsInvalidNumeralVariant, Severity.Error, objectType, objectName, propertyName, numeralVariant.IntValue.ToString(CultureInfo.InvariantCulture));
         return(false);
     }
     return(true);
 }
 private static bool ValidateCalendar(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo calendar, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(calendar != null);
     if (Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == calendar.Type && !Validator.ValidateCalendar(calendar.StringValue))
     {
         errorContext.Register(ProcessingErrorCode.rsInvalidCalendar, Severity.Error, objectType, objectName, propertyName, calendar.StringValue);
         return(false);
     }
     return(true);
 }
 private static bool ValidateBackgroundRepeat(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo repeat, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(repeat != null);
     if (Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == repeat.Type && !Validator.ValidateBackgroundRepeat(repeat.StringValue, objectType))
     {
         errorContext.Register(ProcessingErrorCode.rsInvalidBackgroundRepeat, Severity.Error, objectType, objectName, propertyName, repeat.StringValue);
         return(false);
     }
     return(true);
 }
 internal void AddAttribute(string name, Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expression, ValueType valueType)
 {
     Global.Tracer.Assert(name != null);
     Global.Tracer.Assert(expression != null);
     m_attributes.Add(new StyleInformationAttribute
     {
         Name      = name,
         Value     = expression,
         ValueType = valueType
     });
 }
 internal static bool ValidateSpecificLanguage(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo language, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext, out CultureInfo culture)
 {
     culture = null;
     Global.Tracer.Assert(language != null);
     if (Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == language.Type && !Validator.ValidateSpecificLanguage(language.StringValue, out culture))
     {
         errorContext.Register(ProcessingErrorCode.rsInvalidLanguage, Severity.Error, objectType, objectName, propertyName, language.StringValue);
         return(false);
     }
     return(true);
 }
 internal static bool ValidateSize(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo size, double minValue, double maxValue, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(size != null);
     if (Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == size.Type)
     {
         bool   allowNegative = false;
         double validSizeInMM;
         string newSize;
         return(ValidateSize(size.StringValue, allowNegative, minValue, maxValue, objectType, objectName, propertyName, errorContext, out validSizeInMM, out newSize));
     }
     return(true);
 }
예제 #15
0
 private void Init(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo nameExpr, Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo valueExpr, string name, object value, TypeCode typeCode)
 {
     m_name  = new ReportStringProperty(nameExpr);
     m_value = new ReportVariantProperty(valueExpr);
     if (nameExpr.IsExpression || valueExpr.IsExpression)
     {
         m_instance = new CustomPropertyInstance(this, name, value, typeCode);
     }
     else
     {
         m_instance = null;
     }
 }
 internal static bool ValidateMimeType(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo mimeType, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     if (mimeType == null)
     {
         errorContext.Register(ProcessingErrorCode.rsMissingMIMEType, Severity.Error, objectType, objectName, propertyName);
         return(false);
     }
     if (Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == mimeType.Type)
     {
         return(ValidateMimeType(mimeType.StringValue, objectType, objectName, propertyName, errorContext));
     }
     return(true);
 }
 internal static bool ValidateColor(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo color, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(color != null);
     if (Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == color.Type)
     {
         if (!Validator.ValidateColor(color.StringValue, out string newColor, Validator.IsDynamicImageReportItem(objectType)))
         {
             errorContext.Register(ProcessingErrorCode.rsInvalidColor, Severity.Error, objectType, objectName, propertyName, color.StringValue);
             return(false);
         }
         color.StringValue = newColor;
     }
     return(true);
 }
 private static bool ValidateTransparency(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo transparency, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(transparency != null);
     if (Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == transparency.Type)
     {
         double floatValue = transparency.FloatValue;
         if (floatValue < 0.0 || floatValue > 100.0)
         {
             errorContext.Register(ProcessingErrorCode.rsOutOfRangeSize, Severity.Error, objectType, objectName, propertyName, transparency.OriginalText, "0", "100");
             return(false);
         }
     }
     return(true);
 }
 private static bool ValidateBorderStyle(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo borderStyle, ObjectType objectType, string objectName, bool isDynamicElementSubElement, string propertyName, bool isDefaultBorder, ErrorContext errorContext)
 {
     Global.Tracer.Assert(borderStyle != null);
     if (Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == borderStyle.Type)
     {
         if (!Validator.ValidateBorderStyle(borderStyle.StringValue, isDefaultBorder, objectType, isDynamicElementSubElement, out string validatedStyle))
         {
             errorContext.Register(ProcessingErrorCode.rsInvalidBorderStyle, Severity.Error, objectType, objectName, propertyName, borderStyle.StringValue);
             return(false);
         }
         borderStyle.StringValue = validatedStyle;
     }
     return(true);
 }
예제 #20
0
        public override List <ScopeValueFieldName> GetScopeValueFieldNameCollection(Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet)
        {
            List <ScopeValueFieldName> list = new List <ScopeValueFieldName>();
            int num = 0;

            foreach (ScopeValue item in m_scopeID.QueryRestartPosition)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = Expressions[num];
                string dataField = dataSet.Fields[expressionInfo.FieldIndex].DataField;
                list.Add(new ScopeValueFieldName(dataField, item.Value));
                num++;
            }
            return(list);
        }
 internal ReportDoubleProperty(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo)
     : base(expressionInfo?.IsExpression ?? false, expressionInfo?.OriginalText)
 {
     if (expressionInfo != null && !expressionInfo.IsExpression)
     {
         if (expressionInfo.ConstantType == DataType.Float)
         {
             m_value = expressionInfo.FloatValue;
         }
         else if (!double.TryParse(expressionInfo.StringValue, out m_value))
         {
             m_value = 0.0;
         }
     }
 }
 internal ReportStringProperty(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expression)
     : base(expression?.IsExpression ?? false, expression?.OriginalText)
 {
     if (expression != null && !expression.IsExpression)
     {
         if (expression.ConstantType != DataType.String)
         {
             m_value = expression.OriginalText;
         }
         else
         {
             m_value = expression.StringValue;
         }
     }
 }
 public override RowSkippingControlFlag DoesNotMatchRowRecordField(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.RecordField[] recordFields)
 {
     for (int i = 0; i < m_expressions.Length; i++)
     {
         Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = m_expressions[i];
         object value = m_values[i].Value;
         Microsoft.ReportingServices.ReportIntermediateFormat.RecordField field = recordFields[expressionInfo.FieldIndex];
         bool isSortedAscending = m_sortDirections[i] == SortDirection.Ascending;
         RowSkippingControlFlag rowSkippingControlFlag = CompareFieldWithScopeValueAndStopOnInequality(odpContext, field, value, isSortedAscending, ObjectType.DataSet, m_idcDataSet.Name, "Relationship.QueryRestart");
         if (rowSkippingControlFlag != 0)
         {
             return(rowSkippingControlFlag);
         }
     }
     return(RowSkippingControlFlag.ExactMatch);
 }
예제 #24
0
        public override RowSkippingControlFlag DoesNotMatchRowRecordField(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.RecordField[] recordFields)
        {
            int num = 0;

            foreach (ScopeValue item in m_scopeID.QueryRestartPosition)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = Expressions[num];
                Microsoft.ReportingServices.ReportIntermediateFormat.RecordField    field          = recordFields[expressionInfo.FieldIndex];
                RowSkippingControlFlag rowSkippingControlFlag = CompareFieldWithScopeValueAndStopOnInequality(odpContext, field, item.Value, SortDirections[num], ObjectType.DataSet, m_memberDef.DataScopeInfo.DataSet.Name, "ScopeID.QueryRestart");
                if (rowSkippingControlFlag != 0)
                {
                    return(rowSkippingControlFlag);
                }
                num++;
            }
            return(RowSkippingControlFlag.ExactMatch);
        }
예제 #25
0
 private void ProcessAggregateParams(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expression, ExpressionParser.ExpressionContext context)
 {
     if (expression.Aggregates != null)
     {
         for (int num = expression.Aggregates.Count - 1; num >= 0; num--)
         {
             ProcessAggregateParam(expression.Aggregates[num], context);
         }
     }
     if (expression.RunningValues != null)
     {
         for (int num2 = expression.RunningValues.Count - 1; num2 >= 0; num2--)
         {
             ProcessAggregateParam(expression.RunningValues[num2], context);
         }
     }
 }
예제 #26
0
 private void ProcessExpression(Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expression, ExpressionParser.ExpressionContext context)
 {
     if (expression.Type == Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Expression)
     {
         RegisterExpression(new ExprCompileTimeInfo(expression, context));
         ProcessAggregateParams(expression, context);
     }
     else if (expression.Type == Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Aggregate)
     {
         ProcessAggregateParams(expression, context);
     }
     else if (expression.Type == Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Field && context.Location == Microsoft.ReportingServices.ReportPublishing.LocationFlags.None)
     {
         if (m_reportLevelFieldReferences == null)
         {
             m_reportLevelFieldReferences = new ArrayList();
         }
         m_reportLevelFieldReferences.Add(new ExprCompileTimeInfo(expression, context));
     }
 }
        public bool ShouldSkipCurrentRow()
        {
            FieldsImpl fieldsImpl = m_odpContext.ReportObjectModel.FieldsImpl;
            bool       flag       = true;

            for (int i = 0; i < m_expressions.Count && flag; i++)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = m_expressions[i];
                if (expressionInfo.FieldIndex < 0)
                {
                    flag = false;
                    continue;
                }
                FieldImpl fieldImpl = fieldsImpl[expressionInfo.FieldIndex];
                if (fieldImpl.FieldStatus != 0)
                {
                    return(false);
                }
                flag = (m_odpContext.CompareAndStopOnError(m_values[i], fieldImpl.Value, m_scope.DataScopeObjectType, m_scope.Name, "GroupExpression", extendedTypeComparisons: false) == 0);
            }
            return(flag);
        }
예제 #28
0
 private ReportSizeProperty GetOrCreateMarginProperty(ref ReportSizeProperty property, Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expression)
 {
     if (m_isOldSnapshot || expression == null)
     {
         return(null);
     }
     if (property == null)
     {
         property = new ReportSizeProperty(expression);
     }
     return(property);
 }
예제 #29
0
 internal Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo ParseExpression(string expression, ExpressionParser.ExpressionContext context, ExpressionParser.EvaluationMode evaluationMode, out bool userCollectionReferenced)
 {
     Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = m_langParser.ParseExpression(expression, context, evaluationMode, out userCollectionReferenced);
     ProcessExpression(expressionInfo, context);
     return(expressionInfo);
 }
예제 #30
0
        internal static void ParseRDLConstant(string expression, Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo, DataType constantType, ErrorContext errorContext, ObjectType objectType, string objectName, string propertyName)
        {
            expressionInfo.Type         = Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant;
            expressionInfo.ConstantType = constantType;
            switch (constantType)
            {
            case DataType.String:
                expressionInfo.StringValue = expression;
                break;

            case DataType.Boolean:
            {
                bool boolValue;
                try
                {
                    if (string.Compare(expression, "0", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(expression, "1", StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        errorContext.Register(ProcessingErrorCode.rsInvalidBooleanConstant, Severity.Warning, objectType, objectName, propertyName, expression);
                    }
                    boolValue = XmlConvert.ToBoolean(expression);
                }
                catch (Exception e3)
                {
                    if (AsynchronousExceptionDetection.IsStoppingException(e3))
                    {
                        throw;
                    }
                    boolValue = false;
                    errorContext.Register(ProcessingErrorCode.rsInvalidBooleanConstant, Severity.Error, objectType, objectName, propertyName, expression);
                }
                expressionInfo.BoolValue = boolValue;
                break;
            }

            case DataType.Integer:
            {
                int intValue;
                try
                {
                    intValue = XmlConvert.ToInt32(expression);
                }
                catch (Exception e2)
                {
                    if (AsynchronousExceptionDetection.IsStoppingException(e2))
                    {
                        throw;
                    }
                    intValue = 0;
                    errorContext.Register(ProcessingErrorCode.rsInvalidIntegerConstant, Severity.Error, objectType, objectName, propertyName, expression.MarkAsPrivate());
                }
                expressionInfo.IntValue = intValue;
                break;
            }

            case DataType.Float:
            {
                double floatValue;
                try
                {
                    floatValue = XmlConvert.ToDouble(expression);
                }
                catch (Exception e)
                {
                    if (AsynchronousExceptionDetection.IsStoppingException(e))
                    {
                        throw;
                    }
                    floatValue = 0.0;
                    errorContext.Register(ProcessingErrorCode.rsInvalidFloatConstant, Severity.Error, objectType, objectName, propertyName, expression);
                }
                expressionInfo.FloatValue = floatValue;
                break;
            }

            case DataType.DateTime:
            {
                if (DateTimeUtil.TryParseDateTime(expression, CultureInfo.InvariantCulture, out DateTimeOffset dateTimeOffset, out bool hasTimeOffset))
                {
                    if (hasTimeOffset)
                    {
                        expressionInfo.SetDateTimeValue(dateTimeOffset);
                    }
                    else
                    {
                        expressionInfo.SetDateTimeValue(dateTimeOffset.DateTime);
                    }
                }