Esempio n. 1
0
        private Point RenderSectionWithSimpleContainer(BaseSection section,
                                                       ISimpleContainer container,
                                                       Point offset,
                                                       ReportPageEventArgs rpea)

        {
            Point currentPosition = new Point(section.Location.X + container.Location.X, offset.Y);

//			if (section.VisibleInReport)
//			{

            //Always set section.size to it's original value

            section.Size = this.SectionBounds.DetailSectionRectangle.Size;

            Size containerSize = new Size(section.Items[0].Size.Width, section.Items[0].Size.Height);

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

            section.Render(rpea);

            PrintHelper.AdjustParent(section, section.Items);

            foreach (BaseReportItem item in section.Items)
            {
                ISimpleContainer con = item as ISimpleContainer;
                if (con != null)
                {
                    Rectangle r = StandardPrinter.RenderContainer(container, Evaluator, offset, rpea);
                    currentPosition = PrintHelper.ConvertRectangleToCurentPosition(r);
                }

                else
                {
                    item.SectionOffset = section.SectionOffset;
                    Point saveLocation = item.Location;
                    item.Render(rpea);

                    item.Location = saveLocation;

                    ISimpleContainer cont = item as ISimpleContainer;

                    Rectangle r = StandardPrinter.RenderContainer(cont, Evaluator, currentPosition, rpea);
                    currentPosition = PrintHelper.ConvertRectangleToCurentPosition(r);

                    item.Location = saveLocation;

                    rpea.LocationAfterDraw = new Point(rpea.LocationAfterDraw.X, section.SectionOffset + section.Size.Height);
                }

                section.Items[0].Size = containerSize;
                return(currentPosition);
            }

            return(currentPosition);
//			}
//			return currentPosition;
        }
Esempio n. 2
0
        protected virtual Point RenderSection(ReportPageEventArgs rpea)
        {
            Point currentPosition = Point.Empty;

            this.CurrentSection.Render(rpea);

            Evaluator.SinglePage = this.reportDocument.SinglePage;

            if (this.CurrentSection.Items.Count > 0)
            {
                Rectangle desiredRectangle = Layout.Layout(rpea.PrintPageEventArgs.Graphics, this.CurrentSection);

                Rectangle sectionRectangle = new Rectangle(this.CurrentSection.Location.X,
                                                           this.CurrentSection.Location.Y,
                                                           this.CurrentSection.Size.Width,
                                                           this.CurrentSection.Size.Height);


                if (desiredRectangle.Height >= sectionRectangle.Height)
                {
                    this.CurrentSection.Size = new Size(this.CurrentSection.Size.Width, desiredRectangle.Height + 10);
                }

                if (this.CurrentSection.DrawBorder)
                {
                    StandardPrinter.DrawBorder(rpea.PrintPageEventArgs.Graphics, this.CurrentSection.BaseStyleDecorator);
                }


//					PrintHelper.DebugRectangle(rpea.PrintPageEventArgs.Graphics,Pens.Blue,new Rectangle(CurrentSection.Location,CurrentSection.Size));
            }

            Rectangle r = StandardPrinter.RenderPlainCollection(this.CurrentSection,
                                                                this.CurrentSection.Items,
                                                                Evaluator,
                                                                new Point(this.CurrentSection.Location.X, this.CurrentSection.SectionOffset),
                                                                rpea);

            return(PrintHelper.ConvertRectangleToCurentPosition(r));
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        public void 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;


            ISimpleContainer headerRow = null;

            var simpleContainer = table.Items[0] as ISimpleContainer;

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

//				if (PrintHelper.IsTextOnlyRow(simpleContainer) )
//				{

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

            var r = StandardPrinter.RenderContainer(simpleContainer, evaluator, currentPosition, ReportPageEventArgs);

            currentPosition = PrintHelper.ConvertRectangleToCurentPosition(r);

            table.Location = saveLocation;
//				}
//				else {
            //---------------
            simpleContainer = table.Items[1] as ISimpleContainer;

            int adjust = simpleContainer.Location.Y - saveLocation.Y;

            simpleContainer.Location = new Point(simpleContainer.Location.X, simpleContainer.Location.Y - adjust - 3 * GlobalValues.GapBetweenContainer);
            rs = simpleContainer.Size;

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

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

                this.dataNavigator.Fill(simpleContainer.Items);

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

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

                currentPosition = PrintHelper.ConvertRectangleToCurentPosition(r);

                simpleContainer.Size = rs;
            }while (this.dataNavigator.MoveNext());
            //-----
//				}
        }
Esempio n. 5
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);
        }