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); }