Example #1
0
        private ICSharpCode.Reports.Core.ListStrategy.TableStrategy GroupTableStrategyFactory(GroupColumn sortColumn)
        {
            var reportSettings = new ReportSettings();

            reportSettings.GroupColumnsCollection.Add(sortColumn);
            var tableStrategy = new ICSharpCode.Reports.Core.ListStrategy.TableStrategy(this.table, reportSettings);

            return(tableStrategy);
        }
Example #2
0
        public void CanGroup_All_Elements_are_GroupComparer()
        {
            GroupColumn groupComparer = new GroupColumn("GroupItem", 1, ListSortDirection.Ascending);

            ICSharpCode.Reports.Core.ListStrategy.TableStrategy tableStrategy = GroupTableStrategyFactory(groupComparer);
            tableStrategy.Bind();
            foreach (BaseComparer element in tableStrategy.IndexList)
            {
                GroupComparer checkComparer = element as GroupComparer;
                Assert.IsNotNull(checkComparer);
            }
        }
Example #3
0
        public void CanSort_Ascending_By_TwoColumns()
        {
            SortColumn sc  = new SortColumn("Last", System.ComponentModel.ListSortDirection.Ascending);
            SortColumn sc1 = new SortColumn("RandomInt", System.ComponentModel.ListSortDirection.Ascending);

            ReportSettings reportSettings = new ReportSettings();

            reportSettings.SortColumnsCollection.Add(sc);
            reportSettings.SortColumnsCollection.Add(sc1);

            var    tableStrategy = new ICSharpCode.Reports.Core.ListStrategy.TableStrategy(this.table, reportSettings);
            string v1            = String.Empty;

            foreach (BaseComparer element in tableStrategy.IndexList)
            {
                string v2 = element.ObjectArray[0].ToString();
                Assert.LessOrEqual(v1, v2);
                v1 = v2;
            }
        }
Example #4
0
        public void TableStrategy_CanInit()
        {
            var ts = new ICSharpCode.Reports.Core.ListStrategy.TableStrategy(this.table, new ReportSettings());

            Assert.That(ts != null);
        }
		public void TableStrategy_CanInit()
		{
			var ts = new ICSharpCode.Reports.Core.ListStrategy.TableStrategy(this.table,new ReportSettings());
			Assert.That(ts != null);
		}
		private ICSharpCode.Reports.Core.ListStrategy.TableStrategy GroupTableStrategyFactory (GroupColumn sortColumn)
		{
			var reportSettings = new ReportSettings();
			reportSettings.GroupColumnsCollection.Add(sortColumn);
			var tableStrategy = new ICSharpCode.Reports.Core.ListStrategy.TableStrategy(this.table,reportSettings);
			return tableStrategy;
		}
		public void CanSort_Ascending_By_TwoColumns()
		{
			SortColumn sc = new SortColumn("Last",System.ComponentModel.ListSortDirection.Ascending);
			SortColumn sc1 = new SortColumn("RandomInt",System.ComponentModel.ListSortDirection.Ascending);
			
			ReportSettings reportSettings = new ReportSettings();
			reportSettings.SortColumnsCollection.Add(sc);
			reportSettings.SortColumnsCollection.Add(sc1);
			
			var tableStrategy = new ICSharpCode.Reports.Core.ListStrategy.TableStrategy(this.table,reportSettings);
			string v1 = String.Empty;
			
			foreach (BaseComparer element in tableStrategy.IndexList) {
				string v2 = element.ObjectArray[0].ToString();
				Assert.LessOrEqual(v1,v2);
				v1 = v2;
			}
		}