protected ExporterCollection ConvertItems(ISimpleContainer row, Point offset) { IExportColumnBuilder exportLineBuilder = row as IExportColumnBuilder; if (exportLineBuilder != null) { ExportContainer lineItem = this.exportItemsConverter.ConvertToContainer(offset, row); BaseReportItem baseReportItem = row as BaseReportItem; this.exportItemsConverter.ParentRectangle = new Rectangle(baseReportItem.Location, baseReportItem.Size); if (baseReportItem.BackColor != GlobalValues.DefaultBackColor) { foreach (BaseReportItem i in row.Items) { i.BackColor = baseReportItem.BackColor; } } ExporterCollection list = this.exportItemsConverter.ConvertSimpleItems(offset, row.Items); lineItem.Items.AddRange(list); ExporterCollection containerList = new ExporterCollection(); containerList.Add(lineItem); return(containerList); } return(null); }
protected ExporterCollection ConvertSection(BaseSection section, int dataRow) { // bool debugItemadded = false; FireSectionRenderEvent(section, dataRow); PrintHelper.AdjustParent((BaseSection)section, section.Items); ExporterCollection list = new ExporterCollection(); if (section.DrawBorder == true) { section.Items.Insert(0, CreateDebugItem(section)); // debugItemadded = true; } if (section.Items.Count > 0) { Point offset = new Point(section.Location.X, section.SectionOffset); foreach (IReportItem item in section.Items) { ISimpleContainer container = item as ISimpleContainer; if (container != null) { ExportContainer exportContainer = this.exportItemsConverter.ConvertToContainer(offset, container); AdjustBackColor(container); ExporterCollection clist = this.exportItemsConverter.ConvertSimpleItems(offset, container.Items); exportContainer.Items.AddRange(clist); list.Add(exportContainer); } else { this.exportItemsConverter.ParentRectangle = new Rectangle(section.Location, section.Size); 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); } list = this.exportItemsConverter.ConvertSimpleItems(offset, section.Items); // if (debugItemadded) { // BaseExportColumn debugColumn = list[0]; // debugColumn.StyleDecorator.Location = section.Location; // debugColumn.StyleDecorator.Size = section.Size; // } } } } return(list); }
public ExporterCollection ConvertSimpleItems (Point offset,ReportItemCollection items) { if (items == null) { throw new ArgumentNullException("items"); } ExporterCollection col = new ExporterCollection(); if (items.Count > 0) { foreach(BaseReportItem item in items) { col.Add(ConvertToLineItem(offset,item)); } } return col; }
protected static ExporterCollection ConvertItems (ISimpleContainer row,Point offset) { IExportColumnBuilder exportLineBuilder = row as IExportColumnBuilder; if (exportLineBuilder != null) { ExportContainer exportContainer = ExportHelper.ConvertToContainer(row,offset); ExporterCollection list = ExportHelper.ConvertPlainCollection(row.Items,exportContainer.StyleDecorator.Location); exportContainer.Items.AddRange(list); ExporterCollection containerList = new ExporterCollection(); containerList.Add (exportContainer); return containerList; } return null; }
public static ExporterCollection ConvertPlainCollection (ReportItemCollection items,Point offset) { if (items == null) { throw new ArgumentNullException("items"); } ExporterCollection col = new ExporterCollection(); if (items.Count > 0) { items.SortByLocation(); foreach(BaseReportItem item in items) { var converteditem = ExportHelper.ConvertLineItem(item,offset); col.Add((BaseExportColumn)converteditem); } } return col; }
public static ExporterCollection ConvertPlainCollection(ReportItemCollection items, Point offset) { if (items == null) { throw new ArgumentNullException("items"); } ExporterCollection col = new ExporterCollection(); if (items.Count > 0) { foreach (BaseReportItem item in items) { col.Add(StandardPrinter.ConvertLineItem(item, offset)); } } return(col); }
public ExporterCollection ConvertSimpleItems(Point offset, ReportItemCollection items) { if (items == null) { throw new ArgumentNullException("items"); } ExporterCollection col = new ExporterCollection(); if (items.Count > 0) { foreach (BaseReportItem item in items) { col.Add(ConvertToLineItem(offset, item)); } } return(col); }
public static ExporterCollection ConvertPlainCollection (ReportItemCollection items,Point offset) { if (items == null) { throw new ArgumentNullException("items"); } Console.WriteLine("Convert plain collection"); ExporterCollection col = new ExporterCollection(); if (items.Count > 0) { items.SortByLocation(); foreach(BaseReportItem item in items) { var converteditem = ExportHelper.ConvertLineItem(item,offset); Console.WriteLine("{0} - {1}",converteditem.ToString(),converteditem.StyleDecorator.DisplayRectangle); col.Add((BaseExportColumn)converteditem); } } Console.WriteLine(""); return col; }
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); // Call layouter only once per section Rectangle desiredRectangle = Layouter.Layout(this.Graphics, 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); } 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 { list = StandardPrinter.ConvertPlainCollection(section.Items, offset); } } } return(list); }
protected static ExporterCollection ConvertItems(ISimpleContainer row, Point offset) { IExportColumnBuilder exportLineBuilder = row as IExportColumnBuilder; if (exportLineBuilder != null) { ExportContainer lineItem = StandardPrinter.ConvertToContainer(row, offset); StandardPrinter.AdjustBackColor(row); ExporterCollection list = StandardPrinter.ConvertPlainCollection(row.Items, offset); lineItem.Items.AddRange(list); ExporterCollection containerList = new ExporterCollection(); containerList.Add(lineItem); return(containerList); } return(null); }
public static ExporterCollection ConvertPlainCollection(ReportItemCollection items, Point offset) { if (items == null) { throw new ArgumentNullException("items"); } Console.WriteLine("Convert plain collection"); ExporterCollection col = new ExporterCollection(); if (items.Count > 0) { items.SortByLocation(); foreach (BaseReportItem item in items) { var converteditem = ExportHelper.ConvertLineItem(item, offset); Console.WriteLine("{0} - {1}", converteditem.ToString(), converteditem.StyleDecorator.DisplayRectangle); col.Add((BaseExportColumn)converteditem); } } Console.WriteLine(""); return(col); }
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 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 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); // Call layouter only once per section Rectangle desiredRectangle = Layouter.Layout(this.Graphics,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); } 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 { list = StandardPrinter.ConvertPlainCollection(section.Items,offset); } } } return list; }
public static ExporterCollection ConvertPlainCollection (ReportItemCollection items,Point offset) { if (items == null) { throw new ArgumentNullException("items"); } ExporterCollection col = new ExporterCollection(); if (items.Count > 0) { foreach(BaseReportItem item in items) { col.Add(StandardPrinter.ConvertLineItem(item,offset)); } } return col; }
protected ExporterCollection ConvertSection (BaseSection section,int dataRow) { FireSectionRenderEvent (section ,dataRow); PrintHelper.AdjustParent((BaseSection)section,section.Items); ExporterCollection list = new ExporterCollection(); // if (section.DrawBorder == true) { // section.Items.Insert(0,CreateDebugItem(section)); // } 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); } list = StandardPrinter.ConvertPlainCollection(section.Items,offset); } } } return list; }
protected ExporterCollection ConvertItems (ISimpleContainer row,Point offset) { IExportColumnBuilder exportLineBuilder = row as IExportColumnBuilder; if (exportLineBuilder != null) { ExportContainer lineItem = this.exportItemsConverter.ConvertToContainer(offset,row); BaseReportItem baseReportItem = row as BaseReportItem; this.exportItemsConverter.ParentRectangle = new Rectangle(baseReportItem.Location,baseReportItem.Size); if (baseReportItem.BackColor != GlobalValues.DefaultBackColor) { foreach (BaseReportItem i in row.Items) { i.BackColor = baseReportItem.BackColor; } } ExporterCollection list = this.exportItemsConverter.ConvertSimpleItems(offset,row.Items); lineItem.Items.AddRange(list); ExporterCollection containerList = new ExporterCollection(); containerList.Add (lineItem); return containerList; } return null; }
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 static ExporterCollection ConvertItems (ISimpleContainer row,Point offset) { IExportColumnBuilder exportLineBuilder = row as IExportColumnBuilder; if (exportLineBuilder != null) { ExportContainer lineItem = StandardPrinter.ConvertToContainer(row,offset); StandardPrinter.AdjustBackColor(row); ExporterCollection list = StandardPrinter.ConvertPlainCollection(row.Items,offset); lineItem.Items.AddRange(list); ExporterCollection containerList = new ExporterCollection(); containerList.Add (lineItem); return containerList; } return null; }
protected ExporterCollection ConvertSection (BaseSection section,int dataRow) { // bool debugItemadded = false; FireSectionRenderEvent (section ,dataRow); PrintHelper.AdjustParent((BaseSection)section,section.Items); ExporterCollection list = new ExporterCollection(); if (section.DrawBorder == true) { section.Items.Insert(0,CreateDebugItem(section)); // debugItemadded = true; } if (section.Items.Count > 0) { Point offset = new Point(section.Location.X,section.SectionOffset); foreach (IReportItem item in section.Items) { ISimpleContainer container = item as ISimpleContainer; if (container != null) { ExportContainer exportContainer = this.exportItemsConverter.ConvertToContainer(offset,container); AdjustBackColor (container); ExporterCollection clist = this.exportItemsConverter.ConvertSimpleItems(offset,container.Items); exportContainer.Items.AddRange(clist); list.Add(exportContainer); } else { this.exportItemsConverter.ParentRectangle = new Rectangle (section.Location,section.Size); 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); } list = this.exportItemsConverter.ConvertSimpleItems(offset,section.Items); // if (debugItemadded) { // BaseExportColumn debugColumn = list[0]; // debugColumn.StyleDecorator.Location = section.Location; // debugColumn.StyleDecorator.Size = section.Size; // } } } } return list; }