Пример #1
0
        private Point ConvertGroupHeader(ExporterCollection exportList, BaseSection section, Point offset)
        {
            var retVal  = Point.Empty;
            var rowSize = Size.Empty;
            ReportItemCollection groupCollection = null;

            var groupedRow = new Collection <GroupHeader>(table.Items.OfType <GroupHeader>().ToList());

            if (groupedRow.Count == 0)
            {
                groupCollection = section.Items.ExtractGroupedColumns();
                base.DataNavigator.Fill(groupCollection);
                base.FireSectionRendering(section);
                ExporterCollection list = StandardPrinter.ConvertPlainCollection(groupCollection, offset);

                StandardPrinter.EvaluateRow(base.Evaluator, list);

                exportList.AddRange(list);
                AfterConverting(list);
                retVal = new Point(base.DefaultLeftPosition, offset.Y + groupCollection[0].Size.Height + 20 + (3 * GlobalValues.GapBetweenContainer));
            }
            else
            {
                rowSize = groupedRow[0].Size;
                FillRow(groupedRow[0], base.DataNavigator);
                base.FireGroupHeaderRendering(groupedRow[0]);
                retVal             = ConvertStandardRow(exportList, groupedRow[0]);
                groupedRow[0].Size = rowSize;
            }
            return(retVal);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }