protected override void BuildDetailInternal(BaseSection section) { base.BuildDetailInternal(section); section.SectionOffset = base.SinglePage.SectionBounds.DetailStart.Y; ExporterCollection convertedList = convertedList = base.ConvertSection (base.ReportModel.DetailSection,0); base.SinglePage.Items.AddRange(convertedList); }
static int CalculateLastGap(BaseSection section) { BaseReportItem last = section.Items[section.Items.Count -1]; int sectionHeight = section.Size.Height; int bottom = last.Location.Y + last.Size.Height; return sectionHeight - bottom; }
public Rectangle Layout(Graphics graphics,BaseSection section) { if (graphics == null) { throw new ArgumentNullException("graphics"); } if (section == null) { throw new ArgumentNullException("section"); } // Console.WriteLine("\tLayouter for Container");Console.WriteLine("\tlayouter for section <{0}>",section.Name); Console.WriteLine("\tLayouter for Section"); IEnumerable<BaseReportItem> canGrowShrinkCollection = from bt in section.Items where bt.CanGrow == true select bt; Rectangle desiredSectionRectangle = new Rectangle(section.Location.X, section .Location.Y, section .Size.Width, section.Size.Height); if (canGrowShrinkCollection.Count() > 0) { Rectangle surroundingRec = FindSurroundingRectangle(graphics,canGrowShrinkCollection); if (surroundingRec.Height > desiredSectionRectangle .Height) { desiredSectionRectangle = new Rectangle(section.Location.X, section .Location.Y, section .Size.Width, surroundingRec.Size.Height); } } // Console.WriteLine("\tSection : {0} - DesiredContainerRectangle {1} ",section.Size,desiredSectionRectangle.Size); return desiredSectionRectangle; }
protected override void BuildDetailInternal(BaseSection section) { base.BuildDetailInternal(section); SectionBounds.Offset = new Point(SectionBounds.Offset.X,base.ReportModel.DetailSection.Location.Y); ExporterCollection convertedList = base.ConvertSection (base.ReportModel.DetailSection,0); base.SinglePage.Items.AddRange(convertedList); }
public Rectangle Layout(Graphics graphics,BaseSection section) { if (graphics == null) { throw new ArgumentNullException("graphics"); } if (section == null) { throw new ArgumentNullException("section"); } IEnumerable<BaseReportItem> canGrowShrinkCollection = from bt in section.Items where bt.CanGrow == true select bt; Rectangle desiredSectionRectangle = new Rectangle(section.Location.X, section .Location.Y, section .Size.Width, section.Size.Height); if (canGrowShrinkCollection.Count() > 0) { Rectangle surroundingRec = FindSurroundingRectangle(graphics,canGrowShrinkCollection); if (surroundingRec.Height > desiredSectionRectangle .Height) { desiredSectionRectangle = new Rectangle(section.Location.X, section .Location.Y, section .Size.Width, surroundingRec.Size.Height); } } return desiredSectionRectangle; }
public Rectangle Layout(Graphics graphics,BaseSection section) { if (graphics == null) { throw new ArgumentNullException("graphics"); } if (section == null) { throw new ArgumentNullException("section"); } Console.WriteLine("layouter for {0}",section.Name); IEnumerable<BaseReportItem> canGrowShrinkCollection = from bt in section.Items where bt.CanGrow == true select bt; Rectangle desiredSectionRectangle = new Rectangle(section.Location.X, section .Location.Y, section .Size.Width, section.Size.Height); if (canGrowShrinkCollection.Count() > 0) { Rectangle surroundingRec = FindSurroundingRectangle(graphics,canGrowShrinkCollection); if (surroundingRec.Height > desiredSectionRectangle .Height) { desiredSectionRectangle = new Rectangle(section.Location.X, section .Location.Y, section .Size.Width, surroundingRec.Size.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom ); } } return desiredSectionRectangle; }
public static void FixSectionLayout(Rectangle desiredRectangle, BaseSection section) { Rectangle sectionRectangle = new Rectangle(section.Location, section.Size); if (!sectionRectangle.Contains(desiredRectangle)) { section.Size = new Size(section.Size.Width, desiredRectangle.Size.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom); } }
protected void FireSectionRendering (BaseSection section) { SectionRenderEventArgs srea = new SectionRenderEventArgs(section, this.SinglePage.PageNumber, this.dataNavigator.CurrentRow, section); EventHelper.Raise<SectionRenderEventArgs>(SectionRendering,this,srea); }
public void CalculateGapList (BaseSection section) { GapBetweenItems = new int[section.Items.Count +1]; BaseReportItem oldItem = section.Items[0]; for (int i = 0; i < section.Items.Count; i++) { GapBetweenItems[i] = CalculateGap(oldItem,section.Items[i]); } GapBetweenItems[section.Items.Count] = CalculateLastGap(section); }
public void CheckInitialValues () { BaseSection section = new BaseSection(); Assert.AreEqual(0,section.Items.Count); Assert.AreEqual(0,section.SectionMargin); Assert.AreEqual(0,section.SectionOffset); Assert.AreEqual(false,section.PageBreakAfter); Assert.AreEqual(false,section.DrawBorder); Assert.AreEqual(System.Drawing.Color.White,section.BackColor); }
public override void Initialize(IComponent component) { if (component == null) { throw new ArgumentNullException("component"); } base.Initialize(component); this.section = (BaseSection)component; if (String.IsNullOrEmpty(component.Site.Name)) { component.Site.Name = section.Name; } else { section.Name = component.Site.Name; } GetService (); }
public void MeasureReportHeader (BaseSection section) { if (section == null) { throw new ArgumentNullException("section"); } Size size = Size.Empty; section.SectionOffset = this.printableArea.Location.Y; if (this.firstPage) { size = CalculateSize(section); } else { size = new Size(this.marginBounds.Width,0); } this.reportHeaderRectangle = new Rectangle(this.printableArea.Location,size); }
public void MeasureReportHeader (BaseSection section) { if (section == null) { throw new ArgumentNullException("section"); } Size size = Size.Empty; section.SectionOffset = this.printableArea.Location.Y; if (this.firstPage) { if (section.Items.Count > 0) { size = new Size(this.marginBounds.Width,section.Size.Height + 3 * GlobalValues.GapBetweenContainer); } else { size = new Size(this.marginBounds.Width,0); } } else { size = new Size(this.marginBounds.Width,0); } this.reportHeaderRectangle = new Rectangle(this.printableArea.Location,size); }
protected ExporterCollection ConvertSection (BaseSection section,int dataRow) { FireSectionRenderEvent (section ,dataRow); PrintHelper.AdjustParent((BaseSection)section,section.Items); ExporterCollection list = new ExporterCollection(); if (section.Items.Count > 0) { Point offset = new Point(section.Location.X,section.SectionOffset); foreach (BaseReportItem item in section.Items) { ISimpleContainer container = item as ISimpleContainer; if (container != null) { ExportContainer exportContainer = StandardPrinter.ConvertToContainer(container,offset); StandardPrinter.AdjustBackColor (container); ExporterCollection clist = StandardPrinter.ConvertPlainCollection(container.Items,offset); exportContainer.Items.AddRange(clist); list.Add(exportContainer); } else { Rectangle desiredRectangle = layouter.Layout(this.graphics,section); Rectangle sectionRectangle = new Rectangle(0,0,section.Size.Width,section.Size.Height); if (!sectionRectangle.Contains(desiredRectangle)) { section.Size = new Size(section.Size.Width,desiredRectangle.Size.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom); } list = StandardPrinter.ConvertPlainCollection(section.Items,offset); } } } return list; }
private void WritePages () { this.dataNavigator = this.dataManager.GetNavigator; this.BuildNewPage(); this.dataNavigator.MoveNext(); BaseSection section = base.ReportModel.DetailSection; section.SectionOffset = base.SinglePage.SectionBounds.DetailStart.Y; var p = this.BuildDetail (section,dataNavigator); var r = new Rectangle (SectionBounds.ReportFooterRectangle.Left,p.Y, SectionBounds.ReportFooterRectangle.Size.Width, SectionBounds.ReportFooterRectangle.Size.Height); this.BuildReportFooter(r); this.BuildPageFooter(); //this is the last Page this.AddPage(base.SinglePage); base.FinishRendering(this.dataNavigator); }
private void ProcessSection(TableSection sectionControl, BaseSection section) { if (section is TableSectionControl) { TableSectionControl tableSection = section as TableSectionControl; string sectionTitle = String.Empty; Device.OnPlatform( Android: () => { sectionTitle = OnPlatformString.GetAndroidValue(tableSection.Title); }, iOS: () => { sectionTitle = OnPlatformString.GetiOSValue(tableSection.Title); }, WinPhone: () => { sectionTitle = OnPlatformString.GetWinPhoneValue(tableSection.Title); } ); if (!String.IsNullOrEmpty(sectionTitle)) { sectionControl.Title = sectionTitle; } if (tableSection.Cells.Count > 0) { foreach (BaseCell cell in tableSection.Cells) { ProcessCell(sectionControl, tableSection, cell); } } } }
protected void BuildDetail(BaseSection section, IDataNavigator dataNavigator) { ExporterCollection convertedList = new ExporterCollection(); foreach (BaseReportItem item in section.Items) { IBaseConverter baseConverter = ConverterFactory.CreateConverter(item, dataNavigator, this.SinglePage, this.ExportItemsConverter, base.Layouter); if (baseConverter != null) { baseConverter.SectionRendering += OnSectionRendering; baseConverter.Graphics = base.Graphics; baseConverter.PageFull += new EventHandler <NewPageEventArgs>(OnPageFull); convertedList = baseConverter.Convert(section, item); base.SinglePage.Items.AddRange(convertedList); SetPageFull(); } } }
protected override Point ForcePageBreak(ExporterCollection exporterCollection, BaseSection section) { base.ForcePageBreak(exporterCollection, section); return(base.SectionBounds.ReportHeaderRectangle.Location); }
private static void ShouldDrawBorder (BaseSection section,ExporterCollection list) { if (section.DrawBorder == true) { BaseRectangleItem br = BasePager.CreateDebugItem (section); IBaseExportColumn bec = br.CreateExportColumn(); bec.StyleDecorator.Location = section.Location; list.Insert(0,(BaseExportColumn)bec); } }
protected void FireSectionRenderEvent (BaseSection section,int currentRow) { SectionRenderEventArgs ea = new SectionRenderEventArgs(section, pages.Count, currentRow, section); EventHelper.Raise<SectionRenderEventArgs>(SectionRendering,this,ea); }
protected ExporterCollection ConvertSection (BaseSection section,int dataRow) { Point currentBottom = Point.Empty; bool isContainer = false; PrepareSection(section, dataRow); var convertedSection = new ExporterCollection(); Offset = SectionBounds.Offset; if (section.Items.Count > 0) { Rectangle desiredRectangle = LayoutHelper.CalculateSectionLayout(this.Graphics,section); LayoutHelper.FixSectionLayout(desiredRectangle,section); section.Items.SortByLocation(); GapList gapCalculator = new GapList(); gapCalculator.CalculateGapList(section); int i = 0; foreach (BaseReportItem item in section.Items) { ISimpleContainer simpleContainer = item as ISimpleContainer; if (simpleContainer != null) { isContainer = true; Offset = new Point(Offset.X,Offset.Y + gapCalculator.GapBetweenItems[i] ); var containerSize = simpleContainer.Size; EvaluationHelper.EvaluateReportItems(EvaluatorFacade,simpleContainer.Items); var layouter = (ILayouter)ServiceContainer.GetService(typeof(ILayouter)); LayoutHelper.SetLayoutForRow(Graphics,layouter, simpleContainer); section.MeasureOverride(section.Size); Offset = BaseConverter.ConvertContainer(convertedSection,simpleContainer,Offset.X,Offset); simpleContainer.Size = containerSize; } else { IBaseExportColumn converteditem = null; if (isContainer) { item.Location = new Point(item.Location.X,Offset.Y + gapCalculator.GapBetweenItems[i]); converteditem = ExportHelper.ConvertLineItem(item,new Point(item.Location.X,gapCalculator.GapBetweenItems[i])); isContainer = false; } else { converteditem = ExportHelper.ConvertLineItem(item,Offset); } if (converteditem.StyleDecorator.DisplayRectangle.Bottom > currentBottom.Y) { currentBottom = new Point(converteditem.StyleDecorator.Location.X,converteditem.StyleDecorator.DisplayRectangle.Bottom); } convertedSection.Add((BaseExportColumn)converteditem ); } i ++; } Offset = new Point (Offset.X,Offset.Y + gapCalculator.LastGap); if (currentBottom.Y > Offset.Y) { Offset = new Point (Offset.X,currentBottom.Y); } } SectionBounds.Offset = Offset; return convertedSection; }
protected override Point ForcePageBreak(ExporterCollection exporterCollection, BaseSection section) { base.ForcePageBreak(exporterCollection,section); return SectionBounds.Offset; }
protected Point BuildDetail (BaseSection section,IDataNavigator dataNavigator) { ExporterCollection convertedList = new ExporterCollection(); foreach (BaseReportItem item in section.Items) { IBaseConverter baseConverter = ConverterFactory.CreateConverter(item,dataNavigator, this.SinglePage, base.Layouter); if (baseConverter != null) { baseConverter.SectionRendering += OnSectionRendering; baseConverter.Graphics = base.Graphics; baseConverter.PageFull += new EventHandler<NewPageEventArgs>(OnPageFull); convertedList = baseConverter.Convert(section,item); base.SinglePage.Items.AddRange(convertedList); return baseConverter.CurrentPosition; } } return Point.Empty; }
protected override Point ForcePageBreak(ExporterCollection exporterCollection, BaseSection section) { base.ForcePageBreak(exporterCollection,section); return CalculateStartPosition(); }
public void MeasurePageHeader (BaseSection section) { if (section == null) { throw new ArgumentNullException("section"); } section.SectionOffset = this.reportHeaderRectangle.Bottom + GlobalValues.GapBetweenContainer; Size s = CalculateSize(section); this.pageHeaderRectangle = new Rectangle (this.reportHeaderRectangle.Left, section.SectionOffset, this.marginBounds.Width, s.Height); }
Size CalculateSize(BaseSection section) { Size size = Size.Empty; if (section.Items.Count > 0) { size = new Size(this.marginBounds.Width, section.Size.Height); } else { size = new Size(this.marginBounds.Width, 0); } return size; }
private ExporterCollection ConvertInternal(ExporterCollection exporterCollection) { BaseSection section = table.Parent as BaseSection; ISimpleContainer headerRow = null; Point dataAreaStart = new Point(table.Items[0].Location.X, table.Items[0].Location.Y + base.CurrentPosition.Y); base.CurrentPosition = new Point(PrintHelper.DrawingAreaRelativeToParent(this.table.Parent, this.table).Location.X, base.SectionBounds.DetailArea.Top); base.DefaultLeftPosition = base.CurrentPosition.X; this.table.Items.SortByLocation(); // Header var simpleContainer = table.Items[0] as ISimpleContainer; Size containerSize = Size.Empty; if (simpleContainer.Items.Count > 0) { simpleContainer.Location = new Point(simpleContainer.Location.X, simpleContainer.Location.Y); simpleContainer.Parent = (BaseReportItem)this.table; base.SaveSectionSize(section.Size); containerSize = simpleContainer.Size; if (PrintHelper.IsTextOnlyRow(simpleContainer)) { headerRow = simpleContainer; base.PrepareContainerForConverting(section, headerRow); base.CurrentPosition = ConvertContainer(exporterCollection, headerRow, base.DefaultLeftPosition, base.CurrentPosition); } GroupHeader row = table.Items[1] as GroupHeader; if (row != null) { //grouped do { // GetType child navigator IDataNavigator childNavigator = base.DataNavigator.GetChildNavigator; base.Evaluator.SinglePage.IDataNavigator = childNavigator; // Convert Grouping Header base.CurrentPosition = ConvertGroupHeader(exporterCollection, section, base.CurrentPosition); childNavigator.Reset(); childNavigator.MoveNext(); //Convert children if (childNavigator != null) { do { StandardPrinter.AdjustBackColor(simpleContainer); simpleContainer = table.Items[2] as ISimpleContainer; containerSize = simpleContainer.Size; FillRow(simpleContainer, childNavigator); FireRowRendering(simpleContainer, childNavigator); PrepareContainerForConverting(section, simpleContainer); base.CurrentPosition = ConvertStandardRow(exporterCollection, simpleContainer); simpleContainer.Size = containerSize; CheckForPageBreak(section, simpleContainer, headerRow, exporterCollection); }while (childNavigator.MoveNext()); // GroupFooter base.ConvertGroupFooter(table, exporterCollection); base.PageBreakAfterGroupChange(section, exporterCollection); base.Evaluator.SinglePage.IDataNavigator = base.DataNavigator; } }while (base.DataNavigator.MoveNext()); } else { // No Grouping at all simpleContainer = table.Items[1] as ISimpleContainer; base.SaveSectionSize(section.Size); containerSize = simpleContainer.Size; do { PrintHelper.AdjustSectionLocation(section); CheckForPageBreak(section, simpleContainer, headerRow, exporterCollection); FillRow(simpleContainer, base.DataNavigator); FireRowRendering(simpleContainer, base.DataNavigator); base.PrepareContainerForConverting(section, simpleContainer); base.CurrentPosition = ConvertStandardRow(exporterCollection, simpleContainer); simpleContainer.Size = containerSize; section.Size = base.RestoreSectionSize; }while (base.DataNavigator.MoveNext()); base.DataNavigator.Reset(); base.DataNavigator.MoveNext(); SectionBounds.ReportFooterRectangle = new Rectangle(SectionBounds.ReportFooterRectangle.Left, base.CurrentPosition.Y, SectionBounds.ReportFooterRectangle.Width, SectionBounds.ReportFooterRectangle.Height); } } return(exporterCollection); }
protected void PrepareContainerForConverting(BaseSection section,ISimpleContainer simpleContainer) { Console.WriteLine("PrepareContainerForConverting"); FireSectionRendering(section); LayoutHelper.SetLayoutForRow(Graphics,Layouter,simpleContainer); }
void PrepareSection(BaseSection section, int dataRow) { FireSectionRenderEvent(section, dataRow); PrintHelper.AdjustParent(section, section.Items); PrintHelper.AdjustSectionLocation(section); }
protected ExporterCollection ConvertSection(BaseSection section, int dataRow) { Point currentBottom = Point.Empty; bool isContainer = false; PrepareSection(section, dataRow); var convertedSection = new ExporterCollection(); Offset = SectionBounds.Offset; if (section.Items.Count > 0) { Rectangle desiredRectangle = LayoutHelper.CalculateSectionLayout(this.Graphics, section); LayoutHelper.FixSectionLayout(desiredRectangle, section); section.Items.SortByLocation(); GapList gapCalculator = new GapList(); gapCalculator.CalculateGapList(section); int i = 0; foreach (BaseReportItem item in section.Items) { ISimpleContainer simpleContainer = item as ISimpleContainer; if (simpleContainer != null) { isContainer = true; Offset = new Point(Offset.X, Offset.Y + gapCalculator.GapBetweenItems[i]); var containerSize = simpleContainer.Size; EvaluationHelper.EvaluateReportItems(EvaluatorFacade, simpleContainer.Items); var layouter = (ILayouter)ServiceContainer.GetService(typeof(ILayouter)); LayoutHelper.SetLayoutForRow(Graphics, layouter, simpleContainer); section.MeasureOverride(section.Size); Offset = BaseConverter.ConvertContainer(convertedSection, simpleContainer, Offset.X, Offset); simpleContainer.Size = containerSize; } else { IBaseExportColumn converteditem = null; if (isContainer) { item.Location = new Point(item.Location.X, Offset.Y + gapCalculator.GapBetweenItems[i]); converteditem = ExportHelper.ConvertLineItem(item, new Point(item.Location.X, gapCalculator.GapBetweenItems[i])); isContainer = false; } else { converteditem = ExportHelper.ConvertLineItem(item, Offset); } if (converteditem.StyleDecorator.DisplayRectangle.Bottom > currentBottom.Y) { currentBottom = new Point(converteditem.StyleDecorator.Location.X, converteditem.StyleDecorator.DisplayRectangle.Bottom); } convertedSection.Add((BaseExportColumn)converteditem); } i++; } Offset = new Point(Offset.X, Offset.Y + gapCalculator.LastGap); if (currentBottom.Y > Offset.Y) { Offset = new Point(Offset.X, currentBottom.Y); } } SectionBounds.Offset = Offset; return(convertedSection); }
protected virtual Point ForcePageBreak(ExporterCollection exporterCollection, BaseSection section) { BuildNewPage(exporterCollection, section); return(Point.Empty); }
public void then_overridden_property_reflects_base_element_name() { var basePropertyElementName = ((ElementProperty)BaseSection.Property("SomeProperty")).DeclaringElement.Name; Assert.IsTrue(overriddenSomeValueProperty.ValidationResults.All(e => e.ElementName == string.Format("{0}.{1}", basePropertyElementName, OverridesProperty.DisplayName))); }
protected override Point ForcePageBreak(ExporterCollection exporterCollection, BaseSection section) { base.ForcePageBreak(exporterCollection, section); return(CalculateStartPosition()); }
protected virtual void BuildDetailInternal(BaseSection section) { }
protected override Point ForcePageBreak(ExporterCollection exporterCollection, BaseSection section) { base.ForcePageBreak(exporterCollection, section); return(SectionBounds.Offset); }
public void then_base_property_has_no_validation_errors() { Assert.IsFalse(BaseSection.Property("SomeProperty").ValidationResults.Any()); }
void ConvertSectionInternal(BaseSection section) { ExporterCollection convertedList = base.ConvertSection(section, this.dataNavigator.CurrentRow); base.SinglePage.Items.AddRange(convertedList); }
protected override void BuildDetailInternal(BaseSection section) { base.BuildDetailInternal(section); section.SectionOffset = base.SinglePage.SectionBounds.DetailStart.Y; }
void CheckForPageBreak(BaseSection section, ExporterCollection exporterCollection) { var pageBreakRect = PrintHelper.CalculatePageBreakRectangle((BaseReportItem)section.Items[0],base.CurrentPosition); if (PrintHelper.IsPageFull(pageBreakRect,base.SectionBounds)) { base.CurrentPosition = ForcePageBreak (exporterCollection,section); } }
protected virtual Point ForcePageBreak(ExporterCollection exporterCollection, BaseSection section) { BuildNewPage(exporterCollection,section); return Point.Empty; }
private Point ConvertGroupHeader(ExporterCollection exportList,BaseSection section,Point offset) { var retVal = Point.Empty; var rowSize = Size.Empty; ReportItemCollection groupCollection = null; var groupedRows = section.Items.FindGroupHeader(); if (groupedRows.Count == 0) { groupCollection = section.Items.ExtractGroupedColumns(); base.DataNavigator.Fill(groupCollection); base.FireSectionRendering(section); ExporterCollection list = ExportHelper.ConvertPlainCollection(groupCollection,offset); EvaluationHelper.EvaluateRow(base.Evaluator,list); exportList.AddRange(list); retVal = new Point (DefaultLeftPosition,offset.Y + groupCollection[0].Size.Height + 20 + (3 *GlobalValues.GapBetweenContainer)); } else { FillRow(groupedRows[0],base.DataNavigator); rowSize = groupedRows[0].Size; base.FireGroupHeaderRendering(groupedRows[0]); retVal = ConvertStandardRow(exportList,groupedRows[0]); groupedRows[0].Size = rowSize; } return retVal; }
protected virtual void BuildDetailInternal (BaseSection section) { }
protected void BuildNewPage(ExporterCollection myList,BaseSection section) { FirePageFull(myList); section.SectionOffset = SinglePage.SectionBounds.PageHeaderRectangle.Location.Y; myList.Clear(); }
protected ExporterCollection ConvertSection (BaseSection section,int dataRow) { Point currentBottom = Point.Empty; FireSectionRenderEvent (section ,dataRow); PrintHelper.AdjustParent(section,section.Items); PrintHelper.AdjustSectionLocation(section); var convertedSection = new ExporterCollection(); Offset = SectionBounds.Offset; Point startOffset = Offset; if (section.Items.Count > 0) { Size sectionSize = section.Size; Rectangle desiredRectangle = LayoutHelper.CalculateSectionLayout(this.Graphics,section); LayoutHelper.FixSectionLayout(desiredRectangle,section); section.Items.SortByLocation(); GapList gapCalculator = new GapList(); gapCalculator.CalculateGapList(section); int i = 0; foreach (BaseReportItem item in section.Items) { ISimpleContainer simpleContainer = item as ISimpleContainer; if (simpleContainer != null) { Offset = new Point(Offset.X,Offset.Y + gapCalculator.GapBetweenItems[i] ); var containerSize = simpleContainer.Size; EvaluationHelper.EvaluateReportItems(EvaluatorFacade,simpleContainer.Items); var layouter = (ILayouter)ServiceContainer.GetService(typeof(ILayouter)); LayoutHelper.SetLayoutForRow(Graphics,layouter, simpleContainer); /* * */ /* section.Items.ForEach(delegate(BaseReportItem aitem) { // Console.WriteLine(item.Location); }); var h = section.Items.FindHighestElement(); */ section.MeasureOverride(section.Size); /** */ Offset = BaseConverter.ConvertContainer(convertedSection,simpleContainer,Offset.X,Offset); simpleContainer.Size = containerSize; } else { var converteditem = ExportHelper.ConvertLineItem(item,Offset); if (converteditem != null) { if (converteditem.StyleDecorator.DisplayRectangle.Bottom > currentBottom.Y) { currentBottom = new Point(converteditem.StyleDecorator.Location.X,converteditem.StyleDecorator.DisplayRectangle.Bottom); } convertedSection.Add((BaseExportColumn)converteditem ); } // if (converteditem.StyleDecorator.DisplayRectangle.Bottom > currentBottom.Y) { // currentBottom = new Point(converteditem.StyleDecorator.Location.X,converteditem.StyleDecorator.DisplayRectangle.Bottom); // } // // convertedSection.Add((BaseExportColumn)converteditem ); } i ++; } Offset = new Point (Offset.X,Offset.Y + gapCalculator.LastGap); // Offset = new Point (Offset.X,Offset.Y + 5); if (currentBottom.Y > Offset.Y) { Offset = new Point (Offset.X,currentBottom.Y); } // Offset = new Point (Offset.X,Offset.Y + gapCalculator.LastGap); } SectionBounds.Offset = Offset; return convertedSection; }
protected void BuildNewPage(ExporterCollection myList, BaseSection section) { FirePageFull(myList); section.SectionOffset = SinglePage.SectionBounds.PageHeaderRectangle.Location.Y; myList.Clear(); }
private ExporterCollection ConvertInternal(ExporterCollection mylist) { Point currentPosition = new Point(base.SectionBounds.DetailStart.X, base.SectionBounds.DetailStart.Y); Point dataAreaStart = new Point(baseTable.Items[0].Location.X, baseTable.Items[0].Location.Y + currentPosition.Y); ISimpleContainer headerContainer = null; int defaultLeftPos = PrintHelper.DrawingAreaRelativeToParent(this.baseTable.Parent, this.baseTable).Left; this.baseTable.Items.SortByLocation(); foreach (ISimpleContainer simpleContainer in this.baseTable.Items) { if (simpleContainer.Items.Count > 0) { simpleContainer.Location = new Point(simpleContainer.Location.X + defaultLeftPos, simpleContainer.Location.Y); simpleContainer.Parent = (BaseReportItem)this.baseTable; base.SaveSize(new Size(simpleContainer.Size.Width, simpleContainer.Size.Height)); // Header/FooterRow if (PrintHelper.IsTextOnlyRow(simpleContainer)) { headerContainer = simpleContainer; currentPosition = base.BaseConvert(mylist, headerContainer, defaultLeftPos, currentPosition); } else { // DataRegion base.SaveSize(simpleContainer.Size); do { // BaseSection section = this.baseTable.Parent as BaseSection; section.Location = new Point(section.Location.X, section.SectionOffset); base.FillAndLayoutRow(simpleContainer); if (PrintHelper.IsPageFull(new Rectangle(new Point(simpleContainer.Location.X, currentPosition.Y), simpleContainer.Size), base.SectionBounds)) { base.FirePageFull(mylist); mylist.Clear(); currentPosition = base.BaseConvert(mylist, headerContainer, defaultLeftPos, base.SectionBounds.ReportHeaderRectangle.Location); } currentPosition = base.BaseConvert(mylist, simpleContainer, defaultLeftPos, currentPosition); simpleContainer.Size = base.RestoreSize; }while (base.DataNavigator.MoveNext()); //Allway's reset the DataNavigator base.DataNavigator.Reset(); base.DataNavigator.MoveNext(); SectionBounds.ReportFooterRectangle = new Rectangle(SectionBounds.ReportFooterRectangle.Left, currentPosition.Y, SectionBounds.ReportFooterRectangle.Width, SectionBounds.ReportFooterRectangle.Height); } } } return(mylist); }
public void PlainConstructor() { BaseSection section = new BaseSection(); Assert.AreEqual(String.Empty, section.Name); }
private ExporterCollection ConvertDataRow(ISimpleContainer simpleContainer) { ExporterCollection exporterCollection = new ExporterCollection(); base.CurrentPosition = base.SectionBounds.Offset; var p = base.CurrentPosition; BaseSection section = parent as BaseSection; DefaultLeftPosition = parent.Location.X; Size groupSize = Size.Empty; Size childSize = Size.Empty; if (section.Items.FindGroupHeader().Count > 0) { groupSize = section.Items[0].Size; childSize = section.Items[1].Size; } do { base.SaveSectionSize(section.Size); PrintHelper.AdjustSectionLocation(section); section.Size = this.SectionBounds.DetailSectionRectangle.Size; // did we have GroupedItems at all if (section.Items.FindGroupHeader().Count > 0) { // GetType child navigator IDataNavigator childNavigator = base.DataNavigator.GetChildNavigator; base.Evaluator.SinglePage.IDataNavigator = childNavigator; base.CurrentPosition = ConvertGroupHeader(exporterCollection, section, base.CurrentPosition); section.Size = base.RestoreSectionSize; section.Items[0].Size = groupSize; section.Items[1].Size = childSize; childNavigator.Reset(); childNavigator.MoveNext(); //Convert children if (childNavigator != null) { StandardPrinter.AdjustBackColor(simpleContainer); do { section.Size = base.RestoreSectionSize; section.Items[0].Size = groupSize; section.Items[1].Size = childSize; FillRow(simpleContainer, childNavigator); FireRowRendering(simpleContainer, childNavigator); PrepareContainerForConverting(section, simpleContainer); base.CurrentPosition = ConvertStandardRow(exporterCollection, simpleContainer); CheckForPageBreak(section, exporterCollection); }while (childNavigator.MoveNext()); // GroupFooter base.ConvertGroupFooter(section, exporterCollection); base.PageBreakAfterGroupChange(section, exporterCollection); base.Evaluator.SinglePage.IDataNavigator = base.DataNavigator; } } else { // No Grouping at all, the first item in section.items is the DetailRow Size containerSize = section.Items[0].Size; FillRow(simpleContainer, base.DataNavigator); FireRowRendering(simpleContainer, base.DataNavigator); Console.WriteLine("ConvertDazaRow"); base.PrepareContainerForConverting(section, simpleContainer); base.CurrentPosition = ConvertStandardRow(exporterCollection, simpleContainer); section.Size = base.RestoreSectionSize; section.Items[0].Size = containerSize; } CheckForPageBreak(section, exporterCollection); ShouldDrawBorder(section, exporterCollection); }while (base.DataNavigator.MoveNext()); SectionBounds.ReportFooterRectangle = new Rectangle(SectionBounds.ReportFooterRectangle.Left, section.Location.Y + section.Size.Height, SectionBounds.ReportFooterRectangle.Width, SectionBounds.ReportFooterRectangle.Height); return(exporterCollection); }
public void ConstructorWithNameAsParam() { BaseSection section = new BaseSection("mysection"); Assert.AreEqual("mysection", section.Name); }