public void Table_Should_Contain_GroupFooter()
        {
            ICSharpCode.Reports.Core.BaseTableItem table = CreateContainer();
            //GroupFooter
            var c = new Collection <ICSharpCode.Reports.Core.GroupFooter>(table.Items.OfType <ICSharpCode.Reports.Core.GroupFooter>().ToList());

            Assert.That(c.Count, Is.GreaterThanOrEqualTo(1));
        }
示例#2
0
		public override void CreateDataSection(ICSharpCode.Reports.Core.BaseSection section)
		{
			if (section == null) {
				throw new ArgumentNullException("section");
			}
			System.Drawing.Printing.Margins margin = GlobalValues.ControlMargins;
			
			ICSharpCode.Reports.Core.BaseTableItem table = new ICSharpCode.Reports.Core.BaseTableItem();
			table.Name = "Table1";
			AdjustContainer(base.ReportModel.DetailSection,table);
			base.ReportModel.DetailSection.Items.Add(table);
			
			base.ParentItem = table;
			
			ICSharpCode.Reports.Core.BaseRowItem headerRow = CreateRowWithTextColumns(ParentItem,  this.reportItems);
			ParentItem.Items.Add (headerRow);                                                                 
			
			Point insertLocation =  new Point (margin.Left,headerRow.Location.Y + headerRow.Size.Height + margin.Bottom + margin.Top);
			
			
			if (base.ReportModel.ReportSettings.GroupColumnsCollection.Count > 0) {                 
				var groupHeader = base.CreateGroupHeader(insertLocation);
				ParentItem.Items.Add(groupHeader);
				insertLocation = new Point(margin.Left,insertLocation.Y + groupHeader.Size.Height + margin.Bottom + margin.Top);
			}
			
			//Insert details allways
			
			ICSharpCode.Reports.Core.BaseRowItem detailRow = new ICSharpCode.Reports.Core.BaseRowItem();
			AdjustContainer (ParentItem,detailRow);
			
			detailRow.Location = insertLocation;
			detailRow.Size =  new Size(detailRow.Size.Width,30);

			int defX = AbstractLayout.CalculateControlWidth(detailRow,reportItems);
			
			int startX =  margin.Left;
			
			foreach (ICSharpCode.Reports.Core.BaseReportItem ir in this.reportItems)
			{
				Point np = new Point(startX,margin.Top);
				startX += defX;
				ir.Location = np;
				ir.Parent = detailRow;
				detailRow.Items.Add(ir);
			}
			
			ParentItem.Items.Add (detailRow);
			ParentItem.Size = CalculateContainerSize(ParentItem);
			section.Size = new Size (section.Size.Width,ParentItem.Size.Height + margin.Top + margin.Bottom);
		}
示例#3
0
		public override void CreateDataSection(ICSharpCode.Reports.Core.BaseSection section)
		{
			if (section == null) {
				throw new ArgumentNullException("section");
			}
			System.Drawing.Printing.Margins margin = GlobalValues.ControlMargins;
			
			ICSharpCode.Reports.Core.BaseTableItem table = new ICSharpCode.Reports.Core.BaseTableItem();
			ICSharpCode.Reports.Core.BaseRowItem detailRow = new ICSharpCode.Reports.Core.BaseRowItem();
			
			table.Name = "Table1";
			base.Container = table;
			AdjustContainer(base.ReportModel.DetailSection,table);
			base.ReportModel.DetailSection.Items.Add(table);
			
			ICSharpCode.Reports.Core.BaseRowItem headerRow = CreateRowWithTextColumns(Container);
			Container.Items.Add (headerRow);
			
			Point insertLocation =  new Point (margin.Left,headerRow.Location.Y + headerRow.Size.Height + margin.Bottom + margin.Top);
			
			
			if (base.ReportModel.ReportSettings.GroupColumnsCollection.Count > 0) {
				
				//Groupheader
				var groupHeader = base.CreateGroupHeader(insertLocation);
				Container.Items.Add(groupHeader);
				insertLocation = new Point(margin.Left,insertLocation.Y + groupHeader.Size.Height + margin.Bottom + margin.Top);
				
				//Detail
				CreateDetail(detailRow,insertLocation);
				Container.Items.Add (detailRow);
				
				// GroupFooter
				var groupFooter = base.CreateFooter(new Point(margin.Left,130));
				Container.Items.Add(groupFooter);

			}
			else
			{
				CreateDetail(detailRow,insertLocation);
				Container.Items.Add (detailRow);
			}
			
			CalculateContainerSize();
			section.Size = new Size (section.Size.Width,Container.Size.Height + margin.Top + margin.Bottom);
		}
示例#4
0
        public override void CreateDataSection(ICSharpCode.Reports.Core.BaseSection section)
        {
            if (section == null)
            {
                throw new ArgumentNullException("section");
            }
            System.Drawing.Printing.Margins margin = GlobalValues.ControlMargins;

            ICSharpCode.Reports.Core.BaseTableItem table     = new ICSharpCode.Reports.Core.BaseTableItem();
            ICSharpCode.Reports.Core.BaseRowItem   detailRow = new ICSharpCode.Reports.Core.BaseRowItem();

            table.Name     = "Table1";
            base.Container = table;
            AdjustContainer(base.ReportModel.DetailSection, table);
            base.ReportModel.DetailSection.Items.Add(table);

            ICSharpCode.Reports.Core.BaseRowItem headerRow = CreateRowWithTextColumns(Container);
            Container.Items.Add(headerRow);

            Point insertLocation = new Point(margin.Left, headerRow.Location.Y + headerRow.Size.Height + margin.Bottom + margin.Top);


            if (base.ReportModel.ReportSettings.GroupColumnsCollection.Count > 0)
            {
                //Groupheader
                var groupHeader = base.CreateGroupHeader(insertLocation);
                Container.Items.Add(groupHeader);
                insertLocation = new Point(margin.Left, insertLocation.Y + groupHeader.Size.Height + margin.Bottom + margin.Top);

                //Detail
                CreateDetail(detailRow, insertLocation);
                Container.Items.Add(detailRow);

                // GroupFooter
                var groupFooter = base.CreateFooter(new Point(margin.Left, 130));
                Container.Items.Add(groupFooter);
            }
            else
            {
                CreateDetail(detailRow, insertLocation);
                Container.Items.Add(detailRow);
            }

            CalculateContainerSize();
            section.Size = new Size(section.Size.Width, Container.Size.Height + margin.Top + margin.Bottom);
        }
示例#5
0
        public override void CreateDataSection(ICSharpCode.Reports.Core.BaseSection section)
        {
            if (section == null)
            {
                throw new ArgumentNullException("section");
            }
            System.Drawing.Printing.Margins margin = GlobalValues.ControlMargins;

            ICSharpCode.Reports.Core.BaseTableItem table = new ICSharpCode.Reports.Core.BaseTableItem();
            table.Name = "Table1";

            AdjustContainer(base.ReportModel.DetailSection, table);

            ICSharpCode.Reports.Core.BaseRowItem r1 = CreateRowWithTextColumns(table,
                                                                               this.reportItems);


            ICSharpCode.Reports.Core.BaseRowItem r2 = new ICSharpCode.Reports.Core.BaseRowItem();

            AdjustContainer(table, r2);

            r2.Location = new Point(margin.Left,
                                    r1.Location.Y + r1.Size.Height + margin.Bottom + margin.Top);

            int defX = r2.Size.Width / this.reportItems.Count;

            int startX = r2.Location.X + margin.Left;

            foreach (ICSharpCode.Reports.Core.BaseReportItem ir in this.reportItems)
            {
                Point np = new Point(startX, margin.Top);
                startX     += defX;
                ir.Location = np;
                ir.Parent   = r2;
                r2.Items.Add(ir);
            }

            table.Size = new Size(table.Size.Width,
                                  margin.Top + r1.Size.Height + margin.Bottom + r2.Size.Height + margin.Bottom);
            section.Size = new Size(section.Size.Width, table.Size.Height + margin.Top + margin.Bottom);
            table.Items.Add(r1);
            table.Items.Add(r2);
            base.ReportModel.DetailSection.Items.Add(table);
        }
示例#6
0
		public override void CreateDataSection(ICSharpCode.Reports.Core.BaseSection section)
		{
			if (section == null) {
				throw new ArgumentNullException("section");
			}
			System.Drawing.Printing.Margins margin = GlobalValues.ControlMargins;
			
			ICSharpCode.Reports.Core.BaseTableItem table = new ICSharpCode.Reports.Core.BaseTableItem();
			table.Name = "Table1";
			
			AdjustContainer(base.ReportModel.DetailSection,table);
			
			ICSharpCode.Reports.Core.BaseRowItem r1 = CreateRowWithTextColumns(table,
			                                                                   this.reportItems);
			
			
			ICSharpCode.Reports.Core.BaseRowItem r2 = new ICSharpCode.Reports.Core.BaseRowItem();
			
			AdjustContainer (table,r2);
						
			r2.Location = new Point (margin.Left,
			                         r1.Location.Y + r1.Size.Height + margin.Bottom + margin.Top);

			int defX = r2.Size.Width / this.reportItems.Count;
			
			int startX = r2.Location.X + margin.Left;
			
			foreach (ICSharpCode.Reports.Core.BaseReportItem ir in this.reportItems)
			{
				Point np = new Point(startX,margin.Top);
				startX += defX;
				ir.Location = np;
				ir.Parent = r2;
				r2.Items.Add(ir);
			}
			
			table.Size = new Size (table.Size.Width,
			                       margin.Top + r1.Size.Height + margin.Bottom + r2.Size.Height + margin.Bottom);
			section.Size = new Size (section.Size.Width,table.Size.Height + margin.Top + margin.Bottom);
			table.Items.Add (r1);
			table.Items.Add (r2);
			base.ReportModel.DetailSection.Items.Add(table);
		}
 private ICSharpCode.Reports.Core.BaseTableItem CreateContainer()
 {
     ICSharpCode.Reports.Core.BaseSection   section = this.reportModel.DetailSection;
     ICSharpCode.Reports.Core.BaseTableItem table   = section.Items[0] as ICSharpCode.Reports.Core.BaseTableItem;
     return(table);
 }
 public void PageDetail_Should_Contain_Four_Items()
 {
     ICSharpCode.Reports.Core.BaseTableItem table = CreateContainer();
     Assert.That(table.Items.Count.Equals(4));
 }