예제 #1
0
        private void PrintXAxisFieldsCaption()
        {
            int    top         = (CrossView.ShowTitle ? 1 : 0);
            int    templateTop = titleDescriptor.TemplateRow != null ? 1 : 0;
            string captions    = "";

            for (int i = 0; i < CrossView.Data.XAxisFieldsCount; i++)
            {
                CrossViewHeaderDescriptor descr = crossView.Data.GetRowDescriptor(i);
                if (captions != "")
                {
                    captions += ", ";
                }
                captions += descr.GetName();
            }
            TableCell templateCell = xAxisFieldCaptionDescriptor.TemplateCell;

            if (xAxisFieldCaptionDescriptor.TemplateCell == null)
            {
                templateCell = CreateCell(captions);
            }
            TableCellData resultCell = ResultTable.GetCellData(HeaderWidth, top);

            templateCell.SaveState();
            templateCell.GetData();
            resultCell.RunTimeAssign(templateCell, true);
            resultCell.ColSpan = ResultTable.ColumnCount - HeaderWidth;
            templateCell.RestoreState();
        }
예제 #2
0
        /// <summary>
        /// Removes the specified descriptor from the collection.
        /// </summary>
        /// <param name="value">Descriptor to remove.</param>
        internal void Remove(CrossViewHeaderDescriptor value)
        {
            int i = IndexOf(value);

            if (i != -1)
            {
                List.RemoveAt(i);
            }
        }
예제 #3
0
 /// <summary>
 /// Copies the elements of this collection to a new array.
 /// </summary>
 /// <returns>An array containing copies of this collection elements. </returns>
 internal CrossViewHeaderDescriptor[] ToArray()
 {
     CrossViewHeaderDescriptor[] result = new CrossViewHeaderDescriptor[Count];
     for (int i = 0; i < Count; i++)
     {
         result[i] = this[i];
     }
     return(result);
 }
예제 #4
0
 /// <inheritdoc/>
 public void Deserialize(FRReader reader)
 {
     Clear();
     while (reader.NextItem())
     {
         CrossViewHeaderDescriptor d = new CrossViewHeaderDescriptor();
         reader.Read(d);
         Add(d);
     }
 }
예제 #5
0
 internal void CreateOtherDescriptor()
 {
     titleDescriptor               = new CrossViewDescriptor();
     xAxisFieldCaptionDescriptor   = new CrossViewDescriptor();
     yAxisFieldCaptionDescriptor   = new CrossViewDescriptor();
     noColumnsDescriptor           = new CrossViewHeaderDescriptor();
     noColumnsDescriptor.cell      = 0;
     noColumnsDescriptor.cellsize  = 1;
     noColumnsDescriptor.level     = 0;
     noColumnsDescriptor.levelsize = 1;
     noRowsDescriptor              = new CrossViewHeaderDescriptor();
     noRowsDescriptor.cell         = 0;
     noRowsDescriptor.cellsize     = 1;
     noRowsDescriptor.level        = 0;
     noRowsDescriptor.levelsize    = 1;
     noCellsDescriptor             = new CrossViewCellDescriptor();
 }
        /// <inheritdoc/>
        public override void Assign(CrossViewDescriptor source)
        {
            base.Assign(source);
            CrossViewHeaderDescriptor src = source as CrossViewHeaderDescriptor;

            if (src != null)
            {
                isTotal      = src.isTotal;
                isGrandTotal = src.isGrandTotal;
                fieldName    = src.fieldName;
                measureName  = src.measureName;
                isMeasure    = src.isMeasure;
                level        = src.level;
                levelsize    = src.levelsize;
                cell         = src.cell;
                cellsize     = src.cellsize;
            }
        }
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            CrossViewHeaderDescriptor c = writer.DiffObject as CrossViewHeaderDescriptor;

            base.Serialize(writer);

            writer.ItemName = "Header";
            if (IsTotal != c.IsTotal)
            {
                writer.WriteBool("IsTotal", IsTotal);
            }
            if (IsGrandTotal != c.IsGrandTotal)
            {
                writer.WriteBool("IsGrandTotal", IsGrandTotal);
            }
            if (FieldName != c.FieldName)
            {
                writer.WriteStr("FieldName", FieldName);
            }
            if (MeasureName != c.MeasureName)
            {
                writer.WriteStr("MeasureName", MeasureName);
            }
            if (IsMeasure != c.IsMeasure)
            {
                writer.WriteBool("IsMeasure", IsMeasure);
            }
            if (Cell != c.Cell)
            {
                writer.WriteInt("Cell", Cell);
            }
            if (CellSize != c.CellSize)
            {
                writer.WriteInt("CellSize", CellSize);
            }
            if (Level != c.Level)
            {
                writer.WriteInt("Level", Level);
            }
            if (LevelSize != c.LevelSize)
            {
                writer.WriteInt("LevelSize", LevelSize);
            }
        }
예제 #8
0
        private void PrintCorner()
        {
            int left        = 0;
            int top         = (CrossView.ShowTitle ? 1 : 0);
            int templateTop = titleDescriptor.TemplateRow != null ? 1 : 0;

            if (CrossView.ShowYAxisFieldsCaption)
            {
                for (int i = 0; i < HeaderWidth; i++)
                {
                    TableCell templateCell          = null;
                    CrossViewHeaderDescriptor descr = crossView.Data.GetColumnDescriptor(i);
                    if (descr.TemplateColumn != null)
                    {
                        templateCell = CrossView[0, templateTop];
                    }
                    else
                    {
                        templateCell = CreateCell(descr.GetName());
                    }

                    TableCellData resultCell = ResultTable.GetCellData(left, top);
                    templateCell.SaveState();
                    templateCell.GetData();
                    resultCell.RunTimeAssign(templateCell, true);
                    templateCell.RestoreState();

                    resultCell.RowSpan = HeaderHeight - top;
                    resultCell.Text    = descr.GetName();
                    left++;
                }
            }
            else
            {
                TableCell     templateCell = CreateCell("");
                TableCellData resultCell   = ResultTable.GetCellData(left, top);
                templateCell.SaveState();
                templateCell.GetData();
                resultCell.RunTimeAssign(templateCell, true);
                templateCell.RestoreState();
                resultCell.ColSpan = HeaderWidth;
                resultCell.RowSpan = HeaderHeight - top;
            }
        }
예제 #9
0
        public bool YAxisDrawCellHandler(CrossViewAxisDrawCell crossViewAxisDrawCell)
        {
            CrossViewHeaderDescriptor crossViewHeaderDescriptor = CrossView.Data.Rows[0]; // temp - 0 todoCUBE
            TableCellData             resultCell = ResultTable.GetCellData(axisLeft + crossViewAxisDrawCell.Level, axisTop + crossViewAxisDrawCell.Cell);

            resultCell.ColSpan = crossViewAxisDrawCell.SizeLevel;
            resultCell.RowSpan = crossViewAxisDrawCell.SizeCell;
            TableCell templateCell = crossViewHeaderDescriptor.TemplateCell;

            if (templateCell != null)
            {
                templateCell.Text = crossViewAxisDrawCell.Text;
            }
            else
            {
                templateCell = CreateCell(crossViewAxisDrawCell.Text);
            }
            resultCell.RunTimeAssign(templateCell, true);
            return(false);
        }
예제 #10
0
        private void PrintYAxisTemplate()
        {
            int left = 0;
            int top  = headerHeight;

            for (int i = 0; i < CrossView.Data.Rows.Count; i++)
            {
                CrossViewHeaderDescriptor crossViewHeaderDescriptor = CrossView.Data.Rows[i];
                TableCellData             resultCell = ResultTable.GetCellData(left + crossViewHeaderDescriptor.level, top + crossViewHeaderDescriptor.cell);
                resultCell.ColSpan = crossViewHeaderDescriptor.levelsize;
                resultCell.RowSpan = crossViewHeaderDescriptor.cellsize;
                TableCell templateCell = crossViewHeaderDescriptor.TemplateCell;
                if (templateCell != null)
                {
                    templateCell.Text = "[" + crossViewHeaderDescriptor.GetName() + "]";
                }
                else
                {
                    templateCell = CreateCell("[" + crossViewHeaderDescriptor.GetName() + "]");
                }
                resultCell.RunTimeAssign(templateCell, true);
            }
        }
예제 #11
0
        private void PrintXAxisTemplate()
        {
            int left = headerWidth;
            int top  = (CrossView.ShowTitle ? 1 : 0) + (CrossView.ShowXAxisFieldsCaption ? 1 : 0);

            for (int i = 0; i < CrossView.Data.Columns.Count; i++)
            {
                CrossViewHeaderDescriptor crossViewHeaderDescriptor = CrossView.Data.Columns[i];
                TableCellData             resultCell = ResultTable.GetCellData(left + crossViewHeaderDescriptor.cell, top + crossViewHeaderDescriptor.level);
                resultCell.ColSpan = crossViewHeaderDescriptor.cellsize;
                resultCell.RowSpan = crossViewHeaderDescriptor.levelsize;
                TableCell templateCell = crossViewHeaderDescriptor.TemplateCell;
                if (templateCell != null)
                {
                    templateCell.Text = "[" + crossViewHeaderDescriptor.GetName() + "]";
                }
                else
                {
                    templateCell = CreateCell("[" + crossViewHeaderDescriptor.GetName() + "]");
                }
                resultCell.RunTimeAssign(templateCell, true);
            }
        }
예제 #12
0
 /// <summary>
 /// Determines whether a descriptor is in the collection.
 /// </summary>
 /// <param name="value">The descriptor to locate in the collection.</param>
 /// <returns><b>true</b> if descriptor is found in the collection; otherwise, <b>false</b>.</returns>
 internal bool Contains(CrossViewHeaderDescriptor value)
 {
     return(List.Contains(value));
 }
예제 #13
0
 /// <summary>
 /// Returns the zero-based index of the first occurrence of a descriptor.
 /// </summary>
 /// <param name="value">The descriptor to locate in the collection.</param>
 /// <returns>The zero-based index of the first occurrence of descriptor within
 /// the entire collection, if found; otherwise, -1.</returns>
 internal int IndexOf(CrossViewHeaderDescriptor value)
 {
     return(List.IndexOf(value));
 }
예제 #14
0
 /// <summary>
 /// Inserts a descriptor into this collection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which value should be inserted.</param>
 /// <param name="value">The descriptor to insert.</param>
 internal void Insert(int index, CrossViewHeaderDescriptor value)
 {
     List.Insert(index, value);
 }
예제 #15
0
 /// <summary>
 /// Adds a descriptor to the end of this collection.
 /// </summary>
 /// <param name="value">Descriptor to add.</param>
 /// <returns>Index of the added descriptor.</returns>
 internal int Add(CrossViewHeaderDescriptor value)
 {
     return(List.Add(value));
 }