internal ChartHeadingInstance(ReportProcessing.ProcessingContext pc, int headingCellIndex, ChartHeading chartHeadingDef, int labelIndex, VariantList groupExpressionValues)
 {
     m_uniqueName = pc.CreateUniqueName();
     if (chartHeadingDef.SubHeading != null)
     {
         m_subHeadingInstances = new ChartHeadingInstanceList();
     }
     m_instanceInfo    = new ChartHeadingInstanceInfo(pc, headingCellIndex, chartHeadingDef, labelIndex, groupExpressionValues);
     m_chartHeadingDef = chartHeadingDef;
 }
Exemple #2
0
        private void ChartDataPointInitialize(InitializationContext context, int expectedNumberOfCategories, int expectedNumberOfSeries, bool computedCells)
        {
            if (m_cellDataPoints == null || m_cellDataPoints.Count == 0)
            {
                context.ErrorContext.Register(ProcessingErrorCode.rsMissingChartDataPoints, Severity.Error, context.ObjectType, context.ObjectName, "ChartData");
                return;
            }
            if (expectedNumberOfSeries != m_numberOfSeriesDataPoints.Count)
            {
                context.ErrorContext.Register(ProcessingErrorCode.rsWrongNumberOfChartSeries, Severity.Error, context.ObjectType, context.ObjectName, "ChartSeries");
            }
            bool flag = false;

            for (int i = 0; i < m_numberOfSeriesDataPoints.Count; i++)
            {
                if (flag)
                {
                    break;
                }
                if (m_numberOfSeriesDataPoints[i] != expectedNumberOfCategories)
                {
                    flag = true;
                }
            }
            if (flag)
            {
                context.ErrorContext.Register(ProcessingErrorCode.rsWrongNumberOfChartDataPointsInSeries, Severity.Error, context.ObjectType, context.ObjectName, "ChartSeries");
            }
            int num = expectedNumberOfCategories * expectedNumberOfSeries;

            if (num != m_cellDataPoints.Count)
            {
                context.ErrorContext.Register(ProcessingErrorCode.rsWrongNumberOfChartDataPoints, Severity.Error, context.ObjectType, context.ObjectName, "DataPoints", m_cellDataPoints.Count.ToString(CultureInfo.InvariantCulture), num.ToString(CultureInfo.InvariantCulture));
            }
            context.Location  |= LocationFlags.InMatrixCell;
            context.MatrixName = m_name;
            context.RegisterTablixCellScope(m_columns.SubHeading == null && m_columns.Grouping == null, m_cellAggregates, m_cellPostSortAggregates);
            for (ChartHeading chartHeading = m_rows; chartHeading != null; chartHeading = chartHeading.SubHeading)
            {
                if (chartHeading.Grouping != null)
                {
                    context.Location |= LocationFlags.InGrouping;
                    context.RegisterGroupingScopeForTablixCell(chartHeading.Grouping.Name, column: false, chartHeading.Grouping.SimpleGroupExpressions, chartHeading.Aggregates, chartHeading.PostSortAggregates, chartHeading.RecursiveAggregates, chartHeading.Grouping);
                }
            }
            if (m_rows.Grouping != null && m_rows.Subtotal != null && m_staticRows != null)
            {
                context.CopyRunningValues(StaticRows.RunningValues, m_aggregates);
            }
            for (ChartHeading chartHeading = m_columns; chartHeading != null; chartHeading = chartHeading.SubHeading)
            {
                if (chartHeading.Grouping != null)
                {
                    context.Location |= LocationFlags.InGrouping;
                    context.RegisterGroupingScopeForTablixCell(chartHeading.Grouping.Name, column: true, chartHeading.Grouping.SimpleGroupExpressions, chartHeading.Aggregates, chartHeading.PostSortAggregates, chartHeading.RecursiveAggregates, chartHeading.Grouping);
                }
            }
            if (m_columns.Grouping != null && m_columns.Subtotal != null && m_staticColumns != null)
            {
                context.CopyRunningValues(StaticColumns.RunningValues, m_aggregates);
            }
            Global.Tracer.Assert(m_cellDataPoints != null);
            int count = m_cellDataPoints.Count;
            int num2  = 1;

            switch (m_type)
            {
            case ChartTypes.Stock:
                num2 = ((ChartSubTypes.HighLowClose != m_subType) ? 4 : 3);
                break;

            case ChartTypes.Bubble:
                num2 = 3;
                break;

            case ChartTypes.Scatter:
                num2 = 2;
                break;
            }
            context.RegisterRunningValues(m_cellRunningValues);
            for (int j = 0; j < count; j++)
            {
                Global.Tracer.Assert(m_cellDataPoints[j].DataValues != null);
                if (num2 > m_cellDataPoints[j].DataValues.Count)
                {
                    context.ErrorContext.Register(ProcessingErrorCode.rsWrongNumberOfDataValues, Severity.Error, context.ObjectType, context.ObjectName, "DataValue", m_cellDataPoints[j].DataValues.Count.ToString(CultureInfo.InvariantCulture), num2.ToString(CultureInfo.InvariantCulture));
                }
                m_cellDataPoints[j].Initialize(context);
            }
            context.UnRegisterRunningValues(m_cellRunningValues);
            if (context.IsRunningValueDirectionColumn())
            {
                m_processingInnerGrouping = ProcessingInnerGroupings.Row;
            }
            for (ChartHeading chartHeading = m_rows; chartHeading != null; chartHeading = chartHeading.SubHeading)
            {
                if (chartHeading.Grouping != null)
                {
                    context.UnRegisterGroupingScopeForTablixCell(chartHeading.Grouping.Name, column: false);
                }
            }
            for (ChartHeading chartHeading = m_columns; chartHeading != null; chartHeading = chartHeading.SubHeading)
            {
                if (chartHeading.Grouping != null)
                {
                    context.UnRegisterGroupingScopeForTablixCell(chartHeading.Grouping.Name, column: true);
                }
            }
            context.UnRegisterTablixCellScope();
        }
Exemple #3
0
 internal ChartHeadingInstanceInfo(ReportProcessing.ProcessingContext pc, int headingCellIndex, ChartHeading chartHeadingDef, int labelIndex, VariantList groupExpressionValues)
 {
     m_headingCellIndex = headingCellIndex;
     if (chartHeadingDef.ChartGroupExpression)
     {
         if (groupExpressionValues == null || DBNull.Value == groupExpressionValues[0])
         {
             m_groupExpressionValue = null;
         }
         else
         {
             m_groupExpressionValue = groupExpressionValues[0];
         }
     }
     if (chartHeadingDef.Labels != null)
     {
         ExpressionInfo expressionInfo = chartHeadingDef.Labels[labelIndex];
         if (expressionInfo != null)
         {
             if (chartHeadingDef.Grouping != null)
             {
                 m_headingLabel = pc.ReportRuntime.EvaluateChartDynamicHeadingLabelExpression(chartHeadingDef, expressionInfo, chartHeadingDef.DataRegionDef.Name);
             }
             else
             {
                 m_headingLabel = pc.ReportRuntime.EvaluateChartStaticHeadingLabelExpression(chartHeadingDef, expressionInfo, chartHeadingDef.DataRegionDef.Name);
             }
         }
     }
     if (chartHeadingDef.Grouping == null)
     {
         m_staticGroupingIndex = labelIndex;
     }
     else if (chartHeadingDef.Grouping.CustomProperties != null)
     {
         m_customPropertyInstances = chartHeadingDef.Grouping.CustomProperties.EvaluateExpressions(chartHeadingDef.DataRegionDef.ObjectType, chartHeadingDef.DataRegionDef.Name, chartHeadingDef.Grouping.Name + ".", pc);
     }
 }