Exemplo n.º 1
0
        /// <summary>
        /// Draws the document header
        /// </summary>
        public void DrawHeader()
        {
            RowGroup rowGroup = PageDefinition.Header.RowGroup;

            foreach (Row row in rowGroup.Rows)
            {
                PdfDrawer.NextRow(row.Height, DocumentGroup.Header);
                DrawRow(row.DrawElements, headerData);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Draw rowGroup to the Pdf, when goto nextPage, repeat the header!
        /// 201306060 :: mellorasinxelas to write absolute groups
        /// </summary>
        /// <param name="rowGroup"></param>
        /// <param name="data"></param>
        /// <param name="dGroup"></param>
        public void DrawRowGroup(RowGroup rowGroup, System.Collections.IDictionary data, DocumentGroup dGroup)
        {
            bool absolute = false;

            if (rowGroup is Moon.PDFTemplate.FooterGroup)
            {
                absolute = ((Moon.PDFTemplate.FooterGroup)rowGroup).Absolute;
            }

            float oldY         = -1;
            bool  ignoreAddRow = false;

            if (absolute)
            {
                oldY = PdfDrawer.CurrentY();
                PdfDrawer.SetY(PageDefinition.Margin_bottom + ((rowGroup.Y != -1.0F) ? rowGroup.Y : rowGroup.Height)); //20130610 :: Use sY if is stored, otherwise uses Height.
                ignoreAddRow = true;                                                                                   //position has been stored.
            }

            foreach (Row row in rowGroup.Rows)
            {
                if (!absolute)
                {
                    if (PdfDrawer.isNoMoreY(row.Height, dGroup))
                    {
                        NextPage();
                        DrawHeader();
                    }
                }

                if (ignoreAddRow)
                {
                    ignoreAddRow = false;
                }
                else
                {
                    PdfDrawer.NextRow(row.Height, dGroup);
                }

                DrawRow(row.DrawElements, data);
            }

            //returns to old Y value.
            if (absolute)
            {
                PdfDrawer.SetY(oldY);
            }
        }