public override ExporterCollection Convert(BaseReportItem parent, BaseReportItem item) { if (parent == null) { throw new ArgumentNullException("parent"); } if (item == null) { throw new ArgumentNullException("item"); } ISimpleContainer simpleContainer = item as ISimpleContainer; this.parent = parent; simpleContainer.Parent = parent; PrintHelper.AdjustParent(parent as ISimpleContainer, simpleContainer.Items); if (PrintHelper.IsTextOnlyRow(simpleContainer)) { ExporterCollection myList = new ExporterCollection(); ConvertContainer(myList, simpleContainer, parent.Location.X, new Point(base.SectionBounds.DetailArea.X, base.SectionBounds.DetailArea.Y)); return(myList); } else { return(this.ConvertDataRow(simpleContainer)); } }
public static ExportContainer ConvertToContainer(ISimpleContainer container, Point offset) { if (container == null) { throw new ArgumentNullException("item"); } PrintHelper.AdjustParent(container, container.Items); IExportColumnBuilder lineBuilder = container as IExportColumnBuilder; if (lineBuilder != null) { ExportContainer lineItem = (ExportContainer)lineBuilder.CreateExportColumn(); lineItem.StyleDecorator.Location = new Point(offset.X + lineItem.StyleDecorator.Location.X, offset.Y); lineItem.StyleDecorator.DisplayRectangle = new Rectangle(lineItem.StyleDecorator.Location, lineItem.StyleDecorator.Size); StandardPrinter.AdjustBackColor(container); return(lineItem); } 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); }
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); }
void PrepareSection(BaseSection section, int dataRow) { FireSectionRenderEvent(section, dataRow); PrintHelper.AdjustParent(section, section.Items); PrintHelper.AdjustSectionLocation(section); }