Ejemplo n.º 1
0
        internal MatrixCellInstance AddCell(ReportProcessing.ProcessingContext pc, out NonComputedUniqueNames cellNonComputedUniqueNames)
        {
            Matrix matrix             = (Matrix)m_reportItemDef;
            int    currentCellRIIndex = GetCurrentCellRIIndex();
            bool   flag = matrix.ProcessingInnerGrouping == Pivot.ProcessingInnerGroupings.Column;
            int    num;
            int    colIndex;

            if (flag)
            {
                num      = m_currentOuterStaticIndex;
                colIndex = m_currentInnerStaticIndex;
            }
            else
            {
                colIndex = m_currentOuterStaticIndex;
                num      = m_currentInnerStaticIndex;
            }
            MatrixCellInstance matrixCellInstance = null;

            matrixCellInstance = ((pc.HeadingInstance == null || pc.HeadingInstance.MatrixHeadingDef.Subtotal.StyleClass == null) ? new MatrixCellInstance(num, colIndex, matrix, currentCellRIIndex, pc, out cellNonComputedUniqueNames) : new MatrixSubtotalCellInstance(num, colIndex, matrix, currentCellRIIndex, pc, out cellNonComputedUniqueNames));
            if ((!flag && m_currentCellOuterIndex == 0) || (flag && m_currentCellInnerIndex == 0))
            {
                if (!pc.Pagination.IgnoreHeight)
                {
                    pc.Pagination.AddToCurrentPageHeight(matrix, matrix.MatrixRows[num].HeightValue);
                }
                if (!pc.Pagination.IgnorePageBreak && pc.Pagination.CurrentPageHeight >= pc.Pagination.PageHeight && m_rowInstances.Count > 1)
                {
                    pc.Pagination.SetCurrentPageHeight(matrix, 0.0);
                    m_extraPagesFilled++;
                    matrix.CurrentPage           = m_startPage + m_extraPagesFilled;
                    m_numberOfChildrenOnThisPage = 0;
                }
                else
                {
                    m_numberOfChildrenOnThisPage++;
                }
            }
            if (matrix.ProcessingInnerGrouping == Pivot.ProcessingInnerGroupings.Column)
            {
                m_cells[m_currentCellOuterIndex].Add(matrixCellInstance);
            }
            else
            {
                if (m_currentCellOuterIndex == 0)
                {
                    Global.Tracer.Assert(m_cells.Count == m_currentCellInnerIndex);
                    MatrixCellInstanceList value = new MatrixCellInstanceList();
                    m_cells.Add(value);
                }
                m_cells[m_currentCellInnerIndex].Add(matrixCellInstance);
            }
            m_currentCellInnerIndex++;
            return(matrixCellInstance);
        }
Ejemplo n.º 2
0
        protected override object SearchChildren(int targetUniqueName, ref NonComputedUniqueNames nonCompNames, ChunkManager.RenderingChunkManager chunkManager)
        {
            object obj    = null;
            Matrix matrix = (Matrix)base.ReportItemDef;

            if (matrix.CornerReportItems.Count > 0)
            {
                if (m_cornerContent != null)
                {
                    obj = ((ISearchByUniqueName)m_cornerContent).Find(targetUniqueName, ref nonCompNames, chunkManager);
                    if (obj != null)
                    {
                        return(obj);
                    }
                }
                else
                {
                    NonComputedUniqueNames nonCompNames2 = ((MatrixInstanceInfo)GetInstanceInfo(chunkManager, inPageSection: false)).CornerNonComputedNames;
                    obj = ((ISearchByUniqueName)matrix.CornerReportItems[0]).Find(targetUniqueName, ref nonCompNames2, chunkManager);
                    if (obj != null)
                    {
                        nonCompNames = nonCompNames2;
                        return(obj);
                    }
                }
            }
            obj = ((ISearchByUniqueName)m_columnInstances).Find(targetUniqueName, ref nonCompNames, chunkManager);
            if (obj != null)
            {
                return(obj);
            }
            obj = ((ISearchByUniqueName)m_rowInstances).Find(targetUniqueName, ref nonCompNames, chunkManager);
            if (obj != null)
            {
                return(obj);
            }
            int count = m_cells.Count;

            for (int i = 0; i < count; i++)
            {
                MatrixCellInstanceList matrixCellInstanceList = m_cells[i];
                int count2 = matrixCellInstanceList.Count;
                for (int j = 0; j < count2; j++)
                {
                    MatrixCellInstance     matrixCellInstance = matrixCellInstanceList[j];
                    MatrixCellInstanceInfo instanceInfo       = matrixCellInstance.GetInstanceInfo(chunkManager);
                    int index = instanceInfo.RowIndex * matrix.MatrixColumns.Count + instanceInfo.ColumnIndex;
                    if (matrix.CellReportItems.IsReportItemComputed(index))
                    {
                        if (matrixCellInstance.Content != null)
                        {
                            obj = ((ISearchByUniqueName)matrixCellInstance.Content).Find(targetUniqueName, ref nonCompNames, chunkManager);
                            if (obj != null)
                            {
                                return(obj);
                            }
                        }
                    }
                    else
                    {
                        NonComputedUniqueNames nonCompNames3 = instanceInfo.ContentUniqueNames;
                        obj = ((ISearchByUniqueName)matrix.CellReportItems[index]).Find(targetUniqueName, ref nonCompNames3, chunkManager);
                        if (obj != null)
                        {
                            nonCompNames = nonCompNames3;
                            return(obj);
                        }
                    }
                }
            }
            return(null);
        }
Ejemplo n.º 3
0
 internal MatrixCellInstanceInfo(int rowIndex, int colIndex, Matrix matrixDef, int cellDefIndex, ReportProcessing.ProcessingContext pc, MatrixCellInstance owner, out NonComputedUniqueNames nonComputedUniqueNames)
 {
     m_rowIndex    = rowIndex;
     m_columnIndex = colIndex;
     if (0 < matrixDef.CellReportItems.Count && !matrixDef.CellReportItems.IsReportItemComputed(cellDefIndex))
     {
         m_contentUniqueNames = NonComputedUniqueNames.CreateNonComputedUniqueNames(pc, matrixDef.CellReportItems[cellDefIndex]);
     }
     nonComputedUniqueNames = m_contentUniqueNames;
     Global.Tracer.Assert(cellDefIndex < matrixDef.FirstCellInstances.Count);
     if (matrixDef.FirstCellInstances[cellDefIndex])
     {
         pc.ChunkManager.AddInstanceToFirstPage(this, owner, pc.InPageSection);
         matrixDef.FirstCellInstances[cellDefIndex] = false;
     }
     else
     {
         pc.ChunkManager.AddInstance(this, owner, pc.InPageSection);
     }
 }