예제 #1
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);
            }
        }
예제 #2
0
        //jaimelopez :: 20130606
        /// <summary>
        /// Draws the document footer.
        /// </summary>
        protected void _drawFooter()
        {
            RowGroup rowGroup = PageDefinition.Footer.RowGroup;

            //			if(rowGroup is FooterGroup){
            //				if( ((FooterGroup)rowGroup).Absolute) return; //print int NextPage operation.
            //			}

            if (!(rowGroup is FooterGroup) || !((FooterGroup)rowGroup).Absolute)
            {
                if (rowGroup.Y != -1)
                {
                    if (PdfDrawer.CurrentY() < rowGroup.Y)
                    {
                        NextPage();
                        DrawHeader();
                    }
                    PdfDrawer.SetY(rowGroup.Y);
                }
            }

            DrawRowGroup(rowGroup, footerData, DocumentGroup.Footer);
        }