public ReportDoubleProperty(AspNetCore.ReportingServices.ReportProcessing.ExpressionInfo expressionInfo) : base(expressionInfo != null && expressionInfo.IsExpression, (expressionInfo == null) ? null : expressionInfo.OriginalText) { if (expressionInfo != null && !expressionInfo.IsExpression && !double.TryParse(expressionInfo.Value, out this.m_value)) { this.m_value = 0.0; } }
public ReportStringProperty(AspNetCore.ReportingServices.ReportProcessing.ExpressionInfo expression, string formulaText) : base(expression != null && expression.IsExpression, (expression == null) ? null : ((expression.IsExpression && expression.OriginalText == null) ? formulaText : expression.OriginalText)) { if (expression != null && !expression.IsExpression) { this.m_value = expression.Value; } }
public ReportVariantProperty(AspNetCore.ReportingServices.ReportProcessing.ExpressionInfo expression) : base(expression != null && expression.IsExpression, (expression == null) ? null : expression.OriginalText) { if (expression != null && !expression.IsExpression) { this.m_value = expression.Value; } }
public CustomProperty(RenderingContext renderingContext, AspNetCore.ReportingServices.ReportProcessing.ExpressionInfo nameExpr, AspNetCore.ReportingServices.ReportProcessing.ExpressionInfo valueExpr, string name, object value, TypeCode typeCode) { this.m_name = new ReportStringProperty(nameExpr); this.m_value = new ReportVariantProperty(valueExpr); if (nameExpr.IsExpression || valueExpr.IsExpression) { this.m_instance = new CustomPropertyInstance(this, name, value, typeCode); } this.m_renderingContext = renderingContext; }
public void Initialize(InitializationContext context) { context.ExprHostBuilder.SortingStart(); if (this.m_sortExpressions != null) { for (int i = 0; i < this.m_sortExpressions.Count; i++) { ExpressionInfo expressionInfo = this.m_sortExpressions[i]; expressionInfo.Initialize("SortExpression", context); context.ExprHostBuilder.SortingExpression(expressionInfo); } } context.ExprHostBuilder.SortingEnd(); }
public static bool ValidateLanguage(ExpressionInfo language, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext) { Global.Tracer.Assert(null != language); if (ExpressionInfo.Types.Constant == language.Type) { CultureInfo cultureInfo = null; if (!Validator.ValidateLanguage(language.Value, out cultureInfo)) { errorContext.Register(ProcessingErrorCode.rsInvalidLanguage, Severity.Error, objectType, objectName, propertyName, language.Value); return(false); } } return(true); }
private static bool ValidateColor(ExpressionInfo color, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext) { Global.Tracer.Assert(null != color); if (ExpressionInfo.Types.Constant == color.Type) { string value = default(string); if (!Validator.ValidateColor(color.Value, out value, objectType == ObjectType.Chart)) { errorContext.Register(ProcessingErrorCode.rsInvalidColor, Severity.Error, objectType, objectName, propertyName, color.Value); return(false); } color.Value = value; } return(true); }
private void ProcessAggregateParams(ExpressionInfo expression, ExpressionParser.ExpressionContext context) { if (expression.Aggregates != null) { for (int num = expression.Aggregates.Count - 1; num >= 0; num--) { this.ProcessAggregateParam(expression.Aggregates[num], context); } } if (expression.RunningValues != null) { for (int num2 = expression.RunningValues.Count - 1; num2 >= 0; num2--) { this.ProcessAggregateParam(expression.RunningValues[num2], context); } } }
private static bool ValidateBorderStyle(ExpressionInfo borderStyle, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext) { Global.Tracer.Assert(null != borderStyle); if (ExpressionInfo.Types.Constant == borderStyle.Type) { string value = default(string); if (!Validator.ValidateBorderStyle(borderStyle.Value, out value)) { errorContext.Register(ProcessingErrorCode.rsInvalidBorderStyle, Severity.Error, objectType, objectName, propertyName, borderStyle.Value); return(false); } if (ObjectType.Line == objectType) { borderStyle.Value = value; } } return(true); }
public void Initialize(InitializationContext context) { context.ExprHostBuilder.FilterStart(); if (this.m_expression != null) { this.m_expression.Initialize("FilterExpression", context); context.ExprHostBuilder.FilterExpression(this.m_expression); } if (this.m_values != null) { for (int i = 0; i < this.m_values.Count; i++) { ExpressionInfo expressionInfo = this.m_values[i]; Global.Tracer.Assert(expressionInfo != null); expressionInfo.Initialize("FilterValue", context); context.ExprHostBuilder.FilterValue(expressionInfo); } } this.m_exprHostID = context.ExprHostBuilder.FilterEnd(); }
private void ProcessExpression(ExpressionInfo expression, ExpressionParser.ExpressionContext context) { if (expression.Type == ExpressionInfo.Types.Expression) { this.RegisterExpression(new ExprCompileTimeInfo(expression, context)); this.ProcessAggregateParams(expression, context); } else if (expression.Type == ExpressionInfo.Types.Aggregate) { this.ProcessAggregateParams(expression, context); } else if (expression.Type == ExpressionInfo.Types.Field && context.Location == LocationFlags.None) { if (this.m_reportLevelFieldReferences == null) { this.m_reportLevelFieldReferences = new ArrayList(); } this.m_reportLevelFieldReferences.Add(new ExprCompileTimeInfo(expression, context)); } }
public int[] GetGroupExpressionFieldIndices() { if (this.m_groupExpressionFieldIndices == null) { Global.Tracer.Assert(this.m_groupExpressions != null && 0 < this.m_groupExpressions.Count); this.m_groupExpressionFieldIndices = new int[this.m_groupExpressions.Count]; for (int i = 0; i < this.m_groupExpressions.Count; i++) { this.m_groupExpressionFieldIndices[i] = -2; ExpressionInfo expressionInfo = this.m_groupExpressions[i]; if (expressionInfo.Type == ExpressionInfo.Types.Field) { this.m_groupExpressionFieldIndices[i] = expressionInfo.IntValue; } else if (expressionInfo.Type == ExpressionInfo.Types.Constant) { this.m_groupExpressionFieldIndices[i] = -1; } } } return(this.m_groupExpressionFieldIndices); }
public void AddAttribute(string name, ExpressionInfo expressionInfo) { AttributeInfo attributeInfo = new AttributeInfo(); attributeInfo.IsExpression = (ExpressionInfo.Types.Constant != expressionInfo.Type); if (attributeInfo.IsExpression) { if (this.m_expressionList == null) { this.m_expressionList = new ExpressionInfoList(); } attributeInfo.IntValue = this.m_expressionList.Add(expressionInfo); } else { attributeInfo.Value = expressionInfo.Value; attributeInfo.BoolValue = expressionInfo.BoolValue; attributeInfo.IntValue = expressionInfo.IntValue; } Global.Tracer.Assert(null != this.m_styleAttributes); this.m_styleAttributes.Add(name, attributeInfo); }
public ChartHeadingInstanceInfo(ReportProcessing.ProcessingContext pc, int headingCellIndex, ChartHeading chartHeadingDef, int labelIndex, VariantList groupExpressionValues) { this.m_headingCellIndex = headingCellIndex; if (chartHeadingDef.ChartGroupExpression) { if (groupExpressionValues == null || DBNull.Value == ((ArrayList)groupExpressionValues)[0]) { this.m_groupExpressionValue = null; } else { this.m_groupExpressionValue = ((ArrayList)groupExpressionValues)[0]; } } if (chartHeadingDef.Labels != null) { ExpressionInfo expressionInfo = chartHeadingDef.Labels[labelIndex]; if (expressionInfo != null) { if (chartHeadingDef.Grouping != null) { this.m_headingLabel = pc.ReportRuntime.EvaluateChartDynamicHeadingLabelExpression(chartHeadingDef, expressionInfo, chartHeadingDef.DataRegionDef.Name); } else { this.m_headingLabel = pc.ReportRuntime.EvaluateChartStaticHeadingLabelExpression(chartHeadingDef, expressionInfo, chartHeadingDef.DataRegionDef.Name); } } } if (chartHeadingDef.Grouping == null) { this.m_staticGroupingIndex = labelIndex; } else if (chartHeadingDef.Grouping.CustomProperties != null) { this.m_customPropertyInstances = chartHeadingDef.Grouping.CustomProperties.EvaluateExpressions(chartHeadingDef.DataRegionDef.ObjectType, chartHeadingDef.DataRegionDef.Name, chartHeadingDef.Grouping.Name + ".", pc); } }
public void Initialize(InitializationContext context) { context.ExprHostBuilder.ReportParameterStart(base.Name); if (this.m_defaultExpressions != null) { for (int num = this.m_defaultExpressions.Count - 1; num >= 0; num--) { context.ExprHostBuilder.ReportParameterDefaultValue(this.m_defaultExpressions[num]); } } if (this.m_validValuesValueExpressions != null) { context.ExprHostBuilder.ReportParameterValidValuesStart(); for (int num2 = this.m_validValuesValueExpressions.Count - 1; num2 >= 0; num2--) { ExpressionInfo expressionInfo = this.m_validValuesValueExpressions[num2]; if (expressionInfo != null) { context.ExprHostBuilder.ReportParameterValidValue(expressionInfo); } } context.ExprHostBuilder.ReportParameterValidValuesEnd(); } if (this.m_validValuesLabelExpressions != null) { context.ExprHostBuilder.ReportParameterValidValueLabelsStart(); for (int num3 = this.m_validValuesLabelExpressions.Count - 1; num3 >= 0; num3--) { ExpressionInfo expressionInfo2 = this.m_validValuesLabelExpressions[num3]; if (expressionInfo2 != null) { context.ExprHostBuilder.ReportParameterValidValueLabel(expressionInfo2); } } context.ExprHostBuilder.ReportParameterValidValueLabelsEnd(); } this.ExprHostID = context.ExprHostBuilder.ReportParameterEnd(); }
public CustomPropertyCollection(RenderingContext renderingContext, AspNetCore.ReportingServices.ReportRendering.CustomPropertyCollection collection) { if (collection == null) { this.m_list = new List <CustomProperty>(); } else { int count = collection.Count; this.m_list = new List <CustomProperty>(count); for (int i = 0; i < count; i++) { AspNetCore.ReportingServices.ReportProcessing.ExpressionInfo nameExpr = default(AspNetCore.ReportingServices.ReportProcessing.ExpressionInfo); AspNetCore.ReportingServices.ReportProcessing.ExpressionInfo valueExpr = default(AspNetCore.ReportingServices.ReportProcessing.ExpressionInfo); string name = default(string); object value = default(object); collection.GetNameValueExpressions(i, out nameExpr, out valueExpr, out name, out value); CustomProperty customProperty = new CustomProperty(renderingContext, nameExpr, valueExpr, name, value, TypeCode.Empty); this.m_list.Add(customProperty); this.AddPropToLookupTable(name, customProperty); } } }
private static void ValidateBackgroundImage(ExpressionInfo backgroundImageSource, ExpressionInfo backgroundImageValue, ExpressionInfo backgroundImageMIMEType, Style style, ObjectType objectType, string objectName, ErrorContext errorContext) { if (backgroundImageSource != null) { bool flag = true; Global.Tracer.Assert(ExpressionInfo.Types.Constant == backgroundImageSource.Type); Image.SourceType intValue = (Image.SourceType)backgroundImageSource.IntValue; Global.Tracer.Assert(null != backgroundImageValue); if (Image.SourceType.Database == intValue && ExpressionInfo.Types.Constant == backgroundImageValue.Type) { errorContext.Register(ProcessingErrorCode.rsBinaryConstant, Severity.Error, objectType, objectName, "BackgroundImageValue"); flag = false; } if (Image.SourceType.Database == intValue && !PublishingValidator.ValidateMimeType(backgroundImageMIMEType, objectType, objectName, "BackgroundImageMIMEType", errorContext)) { flag = false; } if (flag) { style.AddAttribute("BackgroundImageSource", backgroundImageSource); style.AddAttribute("BackgroundImageValue", backgroundImageValue); if (Image.SourceType.Database == intValue) { style.AddAttribute("BackgroundImageMIMEType", backgroundImageMIMEType); } } } }
private void CalculateOWCFlags(MatrixHeading heading) { if (heading != null) { if (heading.Grouping == null) { this.m_staticHeadingCount++; if (this.m_staticHeadingCount > 1) { this.m_useOWC = false; return; } if (heading.SubHeading != null) { this.m_useOWC = false; return; } if (heading.ReportItems != null) { int num = 0; while (num < heading.ReportItems.Count) { this.DetectIllegalReportItems(heading.ReportItems[num]); if (this.IsFinish()) { return; } TextBox textBox = this.FindNotAlwaysHiddenTextBox(heading.ReportItems[num]); if (this.IsFinish()) { break; } if (textBox != null) { num++; continue; } this.m_useOWC = false; break; } } goto IL_017d; } ExpressionInfo expressionInfo = null; if (heading.Grouping.GroupExpressions != null) { if (heading.Grouping.GroupExpressions.Count != 1) { this.m_useOWC = false; return; } expressionInfo = heading.Grouping.GroupExpressions[0]; } this.DetectIllegalReportItems(heading.ReportItem); if (!this.IsFinish()) { TextBox textBox2 = this.FindNotAlwaysHiddenTextBox(heading.ReportItem); if (!this.IsFinish()) { if (textBox2 != null) { Global.Tracer.Assert(null != expressionInfo); Global.Tracer.Assert(null != textBox2.Value); if (expressionInfo.OriginalText != textBox2.Value.OriginalText) { this.m_owcGroupExpression.Add(true); } else { this.m_owcGroupExpression.Add(false); } goto IL_017d; } this.m_useOWC = false; } } } return; IL_017d: this.CalculateOWCFlags(heading.SubHeading); }
public void Initialize(InitializationContext context) { Global.Tracer.Assert(null != this.m_styleAttributes); IDictionaryEnumerator enumerator = this.m_styleAttributes.GetEnumerator(); while (enumerator.MoveNext()) { string text = (string)enumerator.Key; AttributeInfo attributeInfo = (AttributeInfo)enumerator.Value; Global.Tracer.Assert(null != text); Global.Tracer.Assert(null != attributeInfo); if (attributeInfo.IsExpression) { string name = text; switch (text) { case "BorderColorLeft": case "BorderColorRight": case "BorderColorTop": case "BorderColorBottom": text = "BorderColor"; break; case "BorderStyleLeft": case "BorderStyleRight": case "BorderStyleTop": case "BorderStyleBottom": text = "BorderStyle"; break; case "BorderWidthLeft": case "BorderWidthRight": case "BorderWidthTop": case "BorderWidthBottom": text = "BorderWidth"; break; } Global.Tracer.Assert(null != this.m_expressionList); ExpressionInfo expressionInfo = this.m_expressionList[attributeInfo.IntValue]; expressionInfo.Initialize(text, context); context.ExprHostBuilder.StyleAttribute(name, expressionInfo); } } AttributeInfo attributeInfo2 = this.m_styleAttributes["BackgroundImageSource"]; if (attributeInfo2 != null) { Global.Tracer.Assert(!attributeInfo2.IsExpression); Image.SourceType intValue = (Image.SourceType)attributeInfo2.IntValue; if (Image.SourceType.Embedded == intValue) { AttributeInfo attributeInfo3 = this.m_styleAttributes["BackgroundImageValue"]; Global.Tracer.Assert(null != attributeInfo3); PublishingValidator.ValidateEmbeddedImageName(attributeInfo3, context.EmbeddedImages, context.ObjectType, context.ObjectName, "BackgroundImageValue", context.ErrorContext); } else if (intValue == Image.SourceType.External) { AttributeInfo attributeInfo4 = this.m_styleAttributes["BackgroundImageValue"]; Global.Tracer.Assert(null != attributeInfo4); if (!attributeInfo4.IsExpression) { context.ImageStreamNames[attributeInfo4.Value] = new ImageInfo(context.ObjectName, null); } } } context.CheckInternationalSettings(this.m_styleAttributes); }
public static Style ValidateAndCreateStyle(StringList names, ExpressionInfoList values, ObjectType objectType, string objectName, ErrorContext errorContext) { Style style = new Style(ConstructionPhase.Publishing); Global.Tracer.Assert(null != names); Global.Tracer.Assert(null != values); Global.Tracer.Assert(names.Count == values.Count); ExpressionInfo backgroundImageSource = null; ExpressionInfo backgroundImageValue = null; ExpressionInfo backgroundImageMIMEType = null; for (int i = 0; i < names.Count; i++) { switch (names[i]) { case "BackgroundImageSource": backgroundImageSource = values[i]; break; case "BackgroundImageValue": backgroundImageValue = values[i]; break; case "BackgroundImageMIMEType": backgroundImageMIMEType = values[i]; break; case "BackgroundRepeat": if (PublishingValidator.ValidateBackgroundRepeat(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "BorderColor": case "BorderColorLeft": case "BorderColorRight": case "BorderColorTop": case "BorderColorBottom": if (PublishingValidator.ValidateColor(values[i], objectType, objectName, "BorderColor", errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "BorderStyle": case "BorderStyleLeft": case "BorderStyleRight": case "BorderStyleTop": case "BorderStyleBottom": if (PublishingValidator.ValidateBorderStyle(values[i], objectType, objectName, "BorderStyle", errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "BorderWidth": case "BorderWidthLeft": case "BorderWidthRight": case "BorderWidthTop": case "BorderWidthBottom": if (PublishingValidator.ValidateSize(values[i], Validator.BorderWidthMin, Validator.BorderWidthMax, objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "BackgroundColor": case "BackgroundGradientEndColor": if (PublishingValidator.ValidateColor(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "BackgroundGradientType": if (PublishingValidator.ValidateBackgroundGradientType(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "FontStyle": if (PublishingValidator.ValidateFontStyle(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "FontFamily": style.AddAttribute(names[i], values[i]); break; case "FontSize": if (PublishingValidator.ValidateSize(values[i], Validator.FontSizeMin, Validator.FontSizeMax, objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "FontWeight": if (PublishingValidator.ValidateFontWeight(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "Format": style.AddAttribute(names[i], values[i]); break; case "TextDecoration": if (PublishingValidator.ValidateTextDecoration(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "TextAlign": if (PublishingValidator.ValidateTextAlign(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "VerticalAlign": if (PublishingValidator.ValidateVerticalAlign(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "Color": if (PublishingValidator.ValidateColor(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "PaddingLeft": case "PaddingRight": case "PaddingTop": case "PaddingBottom": if (PublishingValidator.ValidateSize(values[i], Validator.PaddingMin, Validator.PaddingMax, objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "LineHeight": if (PublishingValidator.ValidateSize(values[i], Validator.LineHeightMin, Validator.LineHeightMax, objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "Direction": if (PublishingValidator.ValidateDirection(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "WritingMode": if (PublishingValidator.ValidateWritingMode(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "Language": { CultureInfo cultureInfo = default(CultureInfo); if (PublishingValidator.ValidateSpecificLanguage(values[i], objectType, objectName, names[i], errorContext, out cultureInfo)) { style.AddAttribute(names[i], values[i]); } break; } case "UnicodeBiDi": if (PublishingValidator.ValidateUnicodeBiDi(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "Calendar": if (PublishingValidator.ValidateCalendar(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "NumeralLanguage": if (PublishingValidator.ValidateLanguage(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; case "NumeralVariant": if (PublishingValidator.ValidateNumeralVariant(values[i], objectType, objectName, names[i], errorContext)) { style.AddAttribute(names[i], values[i]); } break; default: Global.Tracer.Assert(false); break; } } PublishingValidator.ValidateBackgroundImage(backgroundImageSource, backgroundImageValue, backgroundImageMIMEType, style, objectType, objectName, errorContext); if (0 < style.StyleAttributes.Count) { return(style); } return(null); }
public abstract void ConvertField2ComplexExpr(ref ExpressionInfo expression);