private static void ShouldDrawBorder(BaseSection section, ExporterCollection list) { if (section.DrawBorder == true) { BaseRectangleItem br = BasePager.CreateDebugItem(section); BaseExportColumn bec = br.CreateExportColumn(); bec.StyleDecorator.Location = section.Location; list.Insert(0, bec); } }
UIElement ItemFactory (BaseExportColumn column) { UIElement element = null; System.Windows.Controls.Border border = null; var graphicContainer = column as ExportGraphicContainer; if ( graphicContainer != null) { element = CreateGraphicsContainer(graphicContainer); return element; } var container = column as ExportContainer; if (container != null) { element = CreateContainer(container); } var exportGraphic = column as ExportGraphic; if (exportGraphic != null) { element = CreateGraphicsElement(exportGraphic); } var text = column as ExportText; if (text != null) { var t = CreateTextBlock(text); if (column.StyleDecorator.DrawBorder) { border = CreateBorder(column.StyleDecorator as BaseStyleDecorator, GlobalValues.DefaultBorderThickness, GlobalValues.DefaultCornerRadius ); border.Child = t; element = border; } else { element = t; } } var image = column as ExportImage; if (image != null) { element = CreateImageColumn(image); } return element; }
private ExporterCollection ConvertDataRow(ISimpleContainer simpleContainer) { ExporterCollection mylist = new ExporterCollection(); Point currentPosition = new Point(base.SectionBounds.DetailStart.X, base.SectionBounds.DetailStart.Y); BaseSection section = parent as BaseSection; int defaultLeftPos = parent.Location.X; do { section.Location = new Point(section.Location.X, section.SectionOffset); section.Size = this.SectionBounds.DetailSectionRectangle.Size; base.SaveSize(section.Items[0].Size); base.FillAndLayoutRow(simpleContainer); base.FireSectionRendering(section); currentPosition = base.BaseConvert(mylist, simpleContainer, defaultLeftPos, currentPosition); section.Items[0].Size = base.RestoreSize; section.SectionOffset += section.Size.Height + 2 * base.SinglePage.SectionBounds.Gap; if (PrintHelper.IsPageFull(new Rectangle(new Point(simpleContainer.Location.X, currentPosition.Y), section.Size), base.SectionBounds)) { base.FirePageFull(mylist); section.SectionOffset = base.SinglePage.SectionBounds.PageHeaderRectangle.Location.Y; currentPosition = new Point(base.SectionBounds.PageHeaderRectangle.X, base.SectionBounds.PageHeaderRectangle.Y); mylist.Clear(); } if (section.DrawBorder == true) { BaseRectangleItem br = BasePager.CreateDebugItem(section); BaseExportColumn bec = br.CreateExportColumn(); bec.StyleDecorator.Location = section.Location; mylist.Insert(0, bec); } }while (base.DataNavigator.MoveNext()); SectionBounds.ReportFooterRectangle = new Rectangle(SectionBounds.ReportFooterRectangle.Left, section.Location.Y + section.Size.Height, SectionBounds.ReportFooterRectangle.Width, SectionBounds.ReportFooterRectangle.Height); return(mylist); }
/// <summary> /// Convert a single item, Location is calculated as follows /// (X = ParentRectangle.X + Item.X Y = offset.Y + Item.Y) /// </summary> /// <param name="offset"> only Y value is used, gives the offset to Items location.Y </param> /// <param name="item">Item to convert</param> /// <returns></returns> private BaseExportColumn ConvertToLineItem(Point offset, BaseReportItem item) { if (item == null) { throw new ArgumentNullException("item"); } IExportColumnBuilder columnBuilder = item as IExportColumnBuilder; BaseExportColumn lineItem = null; if (columnBuilder != null) { lineItem = columnBuilder.CreateExportColumn(); lineItem.StyleDecorator.Location = new Point(this.ParentRectangle.Location.X + lineItem.StyleDecorator.Location.X, lineItem.StyleDecorator.Location.Y + offset.Y); } return(lineItem); }