Exemplo n.º 1
0
        protected void PrintRow(ReportRow row, float top)
        {
            float left = 0f;
            int   colN = 0;

            foreach (ReportColumn col in Columns)
            {
                Font curFont = col.Font;
                if (row.IsHeader)
                {
                    curFont = new Font(col.Font.FontFamily, col.Font.Size, col.Font.Style | FontStyle.Bold);
                }
                DrawCell(row.Cols[colN], col.Font_color, col.Border_color, curFont, col.TextAlign, left, top, col.Width, col.Height);
                colN++;
                left += col.Width;
            }
        }
Exemplo n.º 2
0
        public override void Print(PrintPageEventArgs ev)
        {
            if (pageCount == 1)
            {
                PrintReportStart();
            }
            RectangleF printableArea = ev.PageBounds;
            // pd.DefaultPageSettings.PrintableArea;

            float header_height = PrintHeader();

            top += header_height;
            top += 0.3f;
            //top += GetFooterHeight();

            float prArea = (float)(printableArea.Height * 2.54 / 100) - (Margin_top / 10) - header_height - GetFooterHeight();

            while (this.rowCount < rows.Count)
            {
                ReportRow row       = (ReportRow)rows[rowCount];
                float     rowHeight = GetRowHeight();
                if (prArea > rowHeight)
                {
                    PrintRow(row, top);
                    top            += rowHeight;
                    printableArea.Y = printableArea.Y + rowHeight;
                    //printableArea.Height = printableArea.Height - rowHeight;
                    prArea = prArea - rowHeight;

                    ++rowCount;
                }
                else
                {
                    break;
                }
            }
            PrintFooter(top);
            ++pageCount;
            ev.HasMorePages = (rowCount < rows.Count);
            if (ev.HasMorePages == false)
            {
                PrintReportEnd();
            }
            //PrintReportEnd();
        }