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.Visible) { //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); PrintHelper.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); }
private Point PrintTextRow(ReportPageEventArgs rpea, BaseRowItem row, int left, Point currentPos) { Rectangle saveRec = new Rectangle(row.Location, row.Size); row.Location = new Point(left, currentPos.Y); EvaluateRecursive(this.expressionEvaluatorFacade, row.Items); PrintHelper.SetLayoutForRow(rpea.PrintPageEventArgs.Graphics, layouter, row); row.Render(rpea); Point retVal = new Point(left, currentPos.Y + row.Size.Height + 10); //reset values row.Size = new Size(saveRec.Size.Width, saveRec.Size.Height); row.Location = saveRec.Location; return(retVal); }
private Point DoContainerControl(BaseSection section, ISimpleContainer container, ReportPageEventArgs rpea) { Point drawPoint = Point.Empty; if (section.Visible) { //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); ISimpleContainer row = (ISimpleContainer)section.Items[0]; PrintHelper.SetLayoutForRow(rpea.PrintPageEventArgs.Graphics, base.Layout, row); section.Render(rpea); foreach (BaseReportItem item in section.Items) { if (item.Parent == null) { item.Parent = section; } item.SectionOffset = section.SectionOffset; item.Render(rpea); drawPoint = new Point(item.Location.X, section.SectionOffset + section.Size.Height); rpea.LocationAfterDraw = new Point(rpea.LocationAfterDraw.X, section.SectionOffset + section.Size.Height); } section.Items[0].Size = containerSize; if ((section.CanGrow == false) && (section.CanShrink == false)) { return(new Point(section.Location.X, section.Size.Height)); } section.Items[0].Size = containerSize; return(drawPoint); } return(drawPoint); }
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()); //----- // } }
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); }
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 as BaseReportItem, tableContainer.Items); if (PrintHelper.IsTextOnlyRow(row)) { PrintHelper.SetLayoutForRow(rpea.PrintPageEventArgs.Graphics, base.Layout, row); Rectangle r = StandardPrinter.RenderContainer(row, Evaluator, currentPosition, rpea); currentPosition = PrintHelper.ConvertRectangleToCurentPosition(r); tableContainer.Location = saveLocation; Console.WriteLine("----"); } 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); PrintHelper.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); }