예제 #1
0
        void FillMatrixRowGroupings()
        {
            XmlNode rGroupings = _Draw.GetNamedChildNode(_MatrixNode, "RowGroupings");

            if (rGroupings == null)
            {
                return;
            }
            float height = _Draw.GetSize(
                DesignXmlDraw.FindNextInHierarchy(_MatrixNode, "MatrixRows", "MatrixRow"),
                "Height");
            int        cols         = 0;
            int        staticRows   = this.CountMatrixRows();
            int        subtotalrows = DesignXmlDraw.CountChildren(rGroupings, "RowGrouping", "DynamicRows", "Subtotal");
            MatrixItem mi;

            foreach (XmlNode c in rGroupings.ChildNodes)
            {
                if (c.Name != "RowGrouping")
                {
                    continue;
                }

                XmlNode srow = DesignXmlDraw.FindNextInHierarchy(c, "StaticRows");
                if (srow != null)
                {                       // Static rows
                    int ri = 0;
                    foreach (XmlNode sr in srow.ChildNodes)
                    {
                        if (sr.Name != "StaticRow")
                        {
                            continue;
                        }
                        XmlNode ris = DesignXmlDraw.FindNextInHierarchy(sr, "ReportItems");
                        mi        = new MatrixItem(ris);
                        mi.Width  = _Draw.GetSize(c, "Width");
                        mi.Height = GetMatrixRowHeight(ri);
                        _MatrixView[_HeaderRows + ri, cols] = mi;
                        ri++;
                    }
                }
                else
                {
                    XmlNode ris = DesignXmlDraw.FindNextInHierarchy(c, "DynamicRows", "ReportItems");
                    mi        = new MatrixItem(ris);
                    mi.Width  = _Draw.GetSize(c, "Width");
                    mi.Height = height;
                    _MatrixView[_HeaderRows, cols] = mi;

                    XmlNode subtotal = DesignXmlDraw.FindNextInHierarchy(c, "DynamicRows", "Subtotal");
                    if (subtotal != null)
                    {
                        ris       = DesignXmlDraw.FindNextInHierarchy(subtotal, "ReportItems");
                        mi        = new MatrixItem(ris);
                        mi.Width  = _Draw.GetSize(c, "Width");
                        mi.Height = height;
                        _MatrixView[_HeaderRows + (staticRows - 1) + subtotalrows, cols] = mi;
                        subtotalrows--;                         // these go backwards
                    }
                }
                cols++;                         // add a column per RowGrouping
            }
        }
예제 #2
0
        void FillMatrixColumnGroupings()
        {
            XmlNode cGroupings = _Draw.GetNamedChildNode(_MatrixNode, "ColumnGroupings");

            if (cGroupings == null)
            {
                return;
            }

            int        rows = 0;
            int        cols = this._HeaderColumns;
            MatrixItem mi;

            XmlNode ris;                                // work variable to hold reportitems
            int     staticCols = this.CountMatrixColumns();

            int subTotalCols = DesignXmlDraw.CountChildren(cGroupings, "ColumnGrouping", "DynamicColumns", "Subtotal");

            foreach (XmlNode c in cGroupings.ChildNodes)
            {
                if (c.Name != "ColumnGrouping")
                {
                    continue;
                }
                XmlNode scol = DesignXmlDraw.FindNextInHierarchy(c, "StaticColumns");
                if (scol != null)
                {                       // Static columns
                    int ci = 0;
                    foreach (XmlNode sc in scol.ChildNodes)
                    {
                        if (sc.Name != "StaticColumn")
                        {
                            continue;
                        }
                        ris       = DesignXmlDraw.FindNextInHierarchy(sc, "ReportItems");
                        mi        = new MatrixItem(ris);
                        mi.Height = _Draw.GetSize(c, "Height");
                        mi.Width  = GetMatrixColumnWidth(ci);
                        _MatrixView[rows, _HeaderColumns + ci] = mi;
                        ci++;
                    }
                }
                else
                {                       // Dynamic Columns
                    ris       = DesignXmlDraw.FindNextInHierarchy(c, "DynamicColumns", "ReportItems");
                    mi        = new MatrixItem(ris);
                    mi.Height = _Draw.GetSize(c, "Height");
                    mi.Width  = GetMatrixColumnWidth(0);
                    _MatrixView[rows, _HeaderColumns] = mi;

                    XmlNode subtotal = DesignXmlDraw.FindNextInHierarchy(c, "DynamicColumns", "Subtotal");
                    if (subtotal != null)
                    {
                        ris       = DesignXmlDraw.FindNextInHierarchy(subtotal, "ReportItems");
                        mi        = new MatrixItem(ris);
                        mi.Height = _Draw.GetSize(c, "Height");
                        mi.Width  = GetMatrixColumnWidth(0);                                    // TODO this is wrong!! should be total of all static widths
                        _MatrixView[rows, _HeaderColumns + (staticCols - 1) + subTotalCols] = mi;
                        subTotalCols--;
                    }
                }
                rows++;                         // add a row per ColumnGrouping
            }
        }