Пример #1
0
        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);
        }
Пример #2
0
		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;
		}
Пример #3
0
        public ExportContainer ConvertToContainer(Point offset, ISimpleContainer item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            IExportColumnBuilder lineBuilder = item as IExportColumnBuilder;

            if (lineBuilder != null)
            {
                ExportContainer lineItem = (ExportContainer)lineBuilder.CreateExportColumn();

                lineItem.StyleDecorator.Location = new Point(lineItem.StyleDecorator.Location.X,
                                                             offset.Y);

                return(lineItem);
            }
            return(null);
        }
Пример #4
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);
        }
Пример #5
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);
        }
		Canvas CreateCanvas(ExportContainer container)
		{
			var canvas = new Canvas();
			SetDimension(canvas, container.StyleDecorator);
			canvas.Background = ConvertBrush(container.StyleDecorator.BackColor);
			return canvas;
		}
		void AddItemsToCanvas(ref Canvas canvas, ExportContainer container)
		{
			foreach (var exportElement in container.Items) {
				var uiElement = ItemFactory(exportElement);
				Canvas.SetLeft(uiElement, exportElement.StyleDecorator.Location.X - container.StyleDecorator.Location.X);
				Canvas.SetTop(uiElement, exportElement.StyleDecorator.Location.Y - container.StyleDecorator.Location.Y);
				canvas.Children.Add(uiElement);
			}
		}
		private UIElement CreateContainer(ExportContainer container)
		{
			var canvas = CreateCanvas(container);
			AddItemsToCanvas(ref canvas, container);
			
			canvas.Measure(PageSize);
			canvas.Arrange(new Rect(new System.Windows.Point(), PageSize));
			canvas.UpdateLayout();
			return canvas;
		}
Пример #9
0
		public ICSharpCode.Reports.Core.Exporter.BaseExportColumn CreateExportColumn()
		{
			BaseStyleDecorator st = this.CreateItemStyle();
			ExportContainer item = new ExportContainer(st);
			return item;
		}
Пример #10
0
		public BaseExportColumn CreateExportColumn()
		{
			BaseStyleDecorator st = this.CreateItemStyle();
			ExportContainer item = new ExportContainer(st);
			return item;
		}