Ejemplo n.º 1
0
        public override void Render(ReportPageEventArgs rpea)
        {
            if (rpea == null)
            {
                throw new ArgumentNullException("rpea");
            }
//
            Point saveLocation    = this.Location;
            Point currentPosition = new Point(this.startSection.Location.X, this.startSection.Location.Y);
            Point tableStart      = currentPosition;

            base.Render(rpea);
            int defaultLeftPos = PrintHelper.DrawingAreaRelativeToParent(this.Parent, this).Left;

            this.Items.SortByLocation();
            rpea.SinglePage.StartRow = this.dataNavigator.CurrentRow;
            foreach (BaseRowItem row in this.items)
            {
                if (row != null)
                {
                    row.Parent = this;
                    if (PrintHelper.IsTextOnlyRow(row))
                    {
                        currentPosition = this.PrintTextRow(rpea, row, defaultLeftPos, currentPosition);
                        this.Location   = saveLocation;
                    }
                    else
                    {
                        do
                        {
                            if (PrintHelper.IsPageFull(new Rectangle(currentPosition, row.Size), sectionBounds))
                            {
                                this.Location = saveLocation;

                                rpea.SinglePage.EndRow = this.dataNavigator.CurrentRow;
                                AbstractRenderer.PageBreak(rpea);
                                return;
                            }
                            currentPosition = this.PrintDataRow(rpea, row, defaultLeftPos, currentPosition);
                        }while (this.dataNavigator.MoveNext());
                    }
                }
            }
            if (this.DrawBorder)
            {
                Border border = new Border(new BaseLine(this.ForeColor, System.Drawing.Drawing2D.DashStyle.Solid, 1));
                border.DrawBorder(rpea.PrintPageEventArgs.Graphics,
                                  new Rectangle(this.Parent.Location.X, tableStart.Y,
                                                this.Parent.Size.Width, currentPosition.Y + 5));
            }
            rpea.LocationAfterDraw = new Point(rpea.LocationAfterDraw.X, rpea.LocationAfterDraw.Y + 20);
            base.NotifyAfterPrint(rpea.LocationAfterDraw);
        }
Ejemplo n.º 2
0
        protected void RenderTable(BaseReportItem parent, ITableContainer tableContainer, ReportPageEventArgs rpea)
        {
            if (rpea == null)
            {
                throw new ArgumentNullException("rpea");
            }

            Point saveLocation = tableContainer.Location;

            Point currentPosition = new Point(PrintHelper.DrawingAreaRelativeToParent(this.CurrentSection, tableContainer).Location.X,
                                              this.CurrentSection.Location.Y);

            tableContainer.Items.SortByLocation();

            Size rs = Size.Empty;

            foreach (BaseRowItem row in tableContainer.Items)
            {
                if (row != null)
                {
                    rs = row.Size;
                    PrintHelper.AdjustParent(tableContainer, tableContainer.Items);

                    if (PrintHelper.IsTextOnlyRow(row))
                    {
                        LayoutHelper.SetLayoutForRow(rpea.PrintPageEventArgs.Graphics, base.Layout, row);

                        Rectangle r = StandardPrinter.RenderContainer(row, Evaluator, currentPosition, rpea);


                        currentPosition = PrintHelper.ConvertRectangleToCurentPosition(r);

                        tableContainer.Location = saveLocation;
                    }
                    else
                    {
                        int adjust = row.Location.Y - saveLocation.Y;
                        row.Location = new Point(row.Location.X, row.Location.Y - adjust - 3 * GlobalValues.GapBetweenContainer);
                        rs           = row.Size;

                        do
                        {
                            if (PrintHelper.IsPageFull(new Rectangle(currentPosition, row.Size), this.SectionBounds))
                            {
                                tableContainer.Location = saveLocation;
                                AbstractRenderer.PageBreak(rpea);
                                return;
                            }

                            this.dataNavigator.Fill(row.Items);

                            LayoutHelper.SetLayoutForRow(rpea.PrintPageEventArgs.Graphics, base.Layout, row);

                            Rectangle r = StandardPrinter.RenderContainer(row, Evaluator, currentPosition, rpea);

                            currentPosition = PrintHelper.ConvertRectangleToCurentPosition(r);

                            row.Size = rs;
                        }while (this.dataNavigator.MoveNext());
                    }
                }
                row.Size = rs;
            }
//			base.NotifyAfterPrint (rpea.LocationAfterDraw);
        }
Ejemplo n.º 3
0
        public void old_Render(ISimpleContainer table, ReportPageEventArgs rpea, IExpressionEvaluatorFacade evaluator)
        {
            if (this.dataNavigator.CurrentRow < 0)
            {
                this.dataNavigator.MoveNext();
            }
            this.reportPageEventArgs = rpea;
            Point     saveLocation  = table.Location;
            Rectangle pageBreakRect = Rectangle.Empty;

            Point currentPosition = new Point(PrintHelper.DrawingAreaRelativeToParent(this.currentSection, table).Location.X,
                                              this.currentSection.Location.Y);

            table.Items.SortByLocation();

            Size rs = Size.Empty;



            foreach (BaseRowItem row in table.Items)
            {
                rs = row.Size;
                PrintHelper.AdjustParent(table as BaseReportItem, table.Items);

                if (PrintHelper.IsTextOnlyRow(row))
                {
                    PrintHelper.SetLayoutForRow(ReportPageEventArgs.PrintPageEventArgs.Graphics, Layouter, row);

                    Rectangle r = StandardPrinter.RenderContainer(row, evaluator, currentPosition, ReportPageEventArgs);

                    currentPosition = PrintHelper.ConvertRectangleToCurentPosition(r);

                    table.Location = saveLocation;
                }
                else
                {
                    int adjust = row.Location.Y - saveLocation.Y;
                    row.Location = new Point(row.Location.X, row.Location.Y - adjust - 3 * GlobalValues.GapBetweenContainer);
                    rs           = row.Size;

                    do
                    {
                        pageBreakRect = PrintHelper.CalculatePageBreakRectangle((BaseReportItem)table, currentPosition);

                        if (PrintHelper.IsPageFull(parentRectangle, this.SectionBounds))
                        {
                            Console.WriteLine("PageBreak - PageFull");
                            table.Location = saveLocation;
                            AbstractRenderer.PageBreak(ReportPageEventArgs);
                            return;
                        }

                        this.dataNavigator.Fill(row.Items);

                        PrintHelper.SetLayoutForRow(ReportPageEventArgs.PrintPageEventArgs.Graphics, Layouter, row);

                        Rectangle r = StandardPrinter.RenderContainer(row, evaluator, currentPosition, ReportPageEventArgs);

                        currentPosition = PrintHelper.ConvertRectangleToCurentPosition(r);

                        row.Size = rs;
                    }while (this.dataNavigator.MoveNext());
                }

                row.Size = rs;
            }
//			base.NotifyAfterPrint (rpea.LocationAfterDraw);
        }