diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj
index fdbf725c03..ae7d1cb23e 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj
@@ -72,9 +72,19 @@
+
+
+
+
+
+
+
+
+
+
@@ -88,6 +98,7 @@
+
@@ -120,18 +131,23 @@
+
+
+
+
+
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs
index b5439b7d81..d70eddcc96 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/ArrangeStrategy.cs
@@ -37,23 +37,38 @@ namespace ICSharpCode.Reporting.Arrange
throw new ArgumentNullException("exportColumn");
var container = exportColumn as IExportContainer;
if ((container != null) && (container.ExportedItems.Count > 0)) {
- BiggestRectangle = Rectangle.Empty;
- foreach (var item in container.ExportedItems) {
- if (item.DesiredSize.Height > BiggestRectangle.Size.Height) {
- BiggestRectangle = new Rectangle(new Point(container.Location.X + item.Location.X,
- container.Location.Y + item.Location.Y)
- ,item.DesiredSize);
+
+ FindBiggestRectangle(container);
+ var resizeable = from resize in container.ExportedItems
+ where ((resize.CanGrow == true))
+ select resize;
+
+
+ if (resizeable.Count() > 0) {
+
+
+
+
+ if (!BiggestRectangle.IsEmpty) {
+ var containerRectangle = new Rectangle(container.Location,container.Size);
+ var desiredRectangle = Rectangle.Union(containerRectangle,BiggestRectangle);
+ container.DesiredSize = new Size(container.Size.Width,desiredRectangle.Size.Height + 5);
}
}
- if (!BiggestRectangle.IsEmpty) {
- var containerRectangle = new Rectangle(container.Location,container.Size);
- var desiredRectangle = Rectangle.Union(containerRectangle,BiggestRectangle);
- container.DesiredSize = new Size(container.Size.Width,desiredRectangle.Size.Height + 5);
- }
}
}
+ private void FindBiggestRectangle (IExportContainer container) {
+ BiggestRectangle = Rectangle.Empty;
+ foreach (var item in container.ExportedItems) {
+ if (item.DesiredSize.Height > BiggestRectangle.Size.Height) {
+ BiggestRectangle = new Rectangle(new Point(container.Location.X + item.Location.X,
+ container.Location.Y + item.Location.Y)
+ ,item.DesiredSize);
+ }
+ }
+ }
public Rectangle BiggestRectangle {get; private set;}
}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/AbstractColumn.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/AbstractColumn.cs
new file mode 100644
index 0000000000..9702ffdf86
--- /dev/null
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/AbstractColumn.cs
@@ -0,0 +1,63 @@
+/*
+ * Created by SharpDevelop.
+ * User: Peter Forstmeier
+ * Date: 21.05.2013
+ * Time: 20:16
+ *
+ * To change this template use Tools | Options | Coding | Edit Standard Headers.
+ */
+using System;
+using System.Xml.Serialization;
+
+namespace ICSharpCode.Reporting.BaseClasses
+{
+ ///
+ /// Description of AbstractColumn.
+ ///
+ public class AbstractColumn
+ {
+ private string columnName;
+ private Type dataType;
+ private string dataTypeName;
+
+ public AbstractColumn() {
+ this.dataType = typeof(System.String);
+ this.columnName = string.Empty;
+ }
+
+// public AbstractColumn(string columnName){
+// this.columnName = columnName;
+// this.dataType = typeof(System.String);
+// }
+
+ public AbstractColumn(string columnName, Type dataType){
+ this.columnName = columnName;
+ this.dataType = dataType;
+ }
+
+ public string ColumnName {get;set;}
+
+
+
+ public string DataTypeName {
+ get {
+ return this.dataType.ToString();
+ }
+ set {
+ dataTypeName = value;
+ this.dataType = Type.GetType(dataTypeName,true,true);
+ }
+ }
+
+ [XmlIgnoreAttribute]
+ public Type DataType {
+ get {
+ return dataType;
+ }
+ set {
+ dataType = value;
+ }
+ }
+
+ }
+}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/Page.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/Page.cs
index 3131ca3615..3feacafeba 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/Page.cs
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/Page.cs
@@ -111,5 +111,9 @@ namespace ICSharpCode.Reporting.BaseClasses
throw new NotImplementedException();
}
}
+
+ public bool CanGrow {get;set;}
+
+ public bool CanShrink {get;set;}
}
}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/SortColumn.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/SortColumn.cs
new file mode 100644
index 0000000000..ca6ce7e5aa
--- /dev/null
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/SortColumn.cs
@@ -0,0 +1,53 @@
+/*
+ * Created by SharpDevelop.
+ * User: Peter Forstmeier
+ * Date: 21.05.2013
+ * Time: 20:20
+ *
+ * To change this template use Tools | Options | Coding | Edit Standard Headers.
+ */
+using System;
+using System.ComponentModel;
+
+namespace ICSharpCode.Reporting.BaseClasses
+{
+ ///
+ /// Description of SortColumn.
+ ///
+ public class SortColumn : AbstractColumn {
+
+ private ListSortDirection sortDirection = ListSortDirection.Ascending;
+ private bool caseSensitive;
+
+
+ public SortColumn():this(String.Empty,ListSortDirection.Ascending,typeof(System.String),false)
+ {
+ }
+
+ public SortColumn(string columnName,Type type ):this(columnName,ListSortDirection.Ascending,type,false)
+ {
+ }
+
+
+ public SortColumn(string columnName,ListSortDirection sortDirection)
+ :this(columnName,sortDirection,typeof(System.String),false){
+ }
+
+
+ public SortColumn(string columnName, ListSortDirection sortDirection, Type type,bool caseSensitive ):base (columnName,type)
+ {
+ this.caseSensitive = caseSensitive;
+ this.sortDirection = sortDirection;
+ }
+
+ #region properties
+
+ public ListSortDirection SortDirection {get;set;}
+
+
+ public bool CaseSensitive {get;private set;}
+
+
+ #endregion
+ }
+}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Collections.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Collections.cs
new file mode 100644
index 0000000000..42ea5cecff
--- /dev/null
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Collections.cs
@@ -0,0 +1,92 @@
+/*
+ * Created by SharpDevelop.
+ * User: Peter Forstmeier
+ * Date: 21.05.2013
+ * Time: 20:03
+ *
+ * To change this template use Tools | Options | Coding | Edit Standard Headers.
+ */
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Globalization;
+using System.Linq;
+
+using ICSharpCode.Reporting.BaseClasses;
+
+namespace ICSharpCode.Reporting
+{
+ ///
+ /// Description of Collections.
+ ///
+
+ public class ColumnCollection: Collection{
+
+ public ColumnCollection()
+ {
+ }
+
+ public AbstractColumn Find (string columnName)
+ {
+ if (String.IsNullOrEmpty(columnName)) {
+ throw new ArgumentNullException("columnName");
+ }
+
+ return this.FirstOrDefault(x => 0 == String.Compare(x.ColumnName,columnName,true,CultureInfo.InvariantCulture));
+ }
+
+
+ public void AddRange (IEnumerable items)
+ {
+ foreach (AbstractColumn item in items){
+ this.Add(item);
+ }
+ }
+
+
+ ///
+ /// The Culture is used for direct String Comparison
+ ///
+
+ public static CultureInfo Culture
+ {
+ get { return CultureInfo.CurrentCulture;}
+ }
+ }
+
+
+
+ public class SortColumnCollection: ColumnCollection
+ {
+ public SortColumnCollection()
+ {
+ }
+
+// public new AbstractColumn Find (string columnName)
+// {
+// if (String.IsNullOrEmpty(columnName)) {
+// throw new ArgumentNullException("columnName");
+// }
+//
+// return this.FirstOrDefault(x => 0 == String.Compare(x.ColumnName,columnName,true,CultureInfo.InvariantCulture));
+// }
+
+
+ public void AddRange (IEnumerable items)
+ {
+ foreach (SortColumn item in items){
+ this.Add(item);
+ }
+ }
+
+
+ ///
+ /// The Culture is used for direct String Comparison
+ ///
+
+// public new static CultureInfo Culture
+// {
+// get { return CultureInfo.CurrentCulture;}
+// }
+ }
+}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionSource.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionSource.cs
new file mode 100644
index 0000000000..afbd22e3e6
--- /dev/null
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionSource.cs
@@ -0,0 +1,89 @@
+/*
+ * Created by SharpDevelop.
+ * User: Peter Forstmeier
+ * Date: 21.05.2013
+ * Time: 20:09
+ *
+ * To change this template use Tools | Options | Coding | Edit Standard Headers.
+ */
+using System;
+using System.Collections;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+
+using ICSharpCode.Reporting.BaseClasses;
+using ICSharpCode.Reporting.DataSource;
+using ICSharpCode.Reporting.Interfaces.Data;
+using ICSharpCode.Reporting.Items;
+
+namespace ICSharpCode.Reporting.DataManager.Listhandling
+{
+ ///
+ /// Description of CollectionHandling.
+ ///
+ internal class CollectionSource:IDataViewHandling
+ {
+
+ private PropertyDescriptorCollection listProperties;
+ private DataCollection
+
+
@@ -75,6 +77,7 @@
+
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/DataSource/CollectionHandlingFixture.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/DataSource/CollectionHandlingFixture.cs
new file mode 100644
index 0000000000..6f656ccbad
--- /dev/null
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/DataSource/CollectionHandlingFixture.cs
@@ -0,0 +1,57 @@
+/*
+ * Created by SharpDevelop.
+ * User: Peter Forstmeier
+ * Date: 20.05.2013
+ * Time: 18:15
+ *
+ * To change this template use Tools | Options | Coding | Edit Standard Headers.
+ */
+using System;
+using System.Collections.Generic;
+using ICSharpCode.Reporting.DataManager.Listhandling;
+using ICSharpCode.Reporting.DataSource;
+using ICSharpCode.Reporting.Items;
+using NUnit.Framework;
+
+namespace ICSharpCode.Reporting.Test.DataSource
+{
+ [TestFixture]
+ public class CollectionHandlingFixture
+ {
+
+ private ContributorCollection list;
+
+ [Test]
+ public void CanInitDataCollection()
+ {
+ var collectionSource = new CollectionSource (list,new ReportSettings());
+ Assert.That(collectionSource,Is.Not.Null);
+ }
+
+
+ [Test]
+ public void CollectionCountIsEqualToListCount() {
+ var collectionSource = new CollectionSource (list,new ReportSettings());
+ Assert.That(collectionSource.Count,Is.EqualTo(list.Count));
+ }
+
+
+ [Test]
+ public void AvailableFieldsEqualContibutorsPropertyCount() {
+ var collectionSource = new CollectionSource (list,new ReportSettings());
+ Assert.That(collectionSource.AvailableFields.Count,Is.EqualTo(7));
+ }
+
+
+
+//http://stackoverflow.com/questions/5378293/simplest-way-to-filter-generic-list
+//http://stackoverflow.com/questions/5378293/simplest-way-to-filter-generic-list
+//http://netmatze.wordpress.com/2012/06/21/implementing-a-generic-iequalitycomparer-and-icomparer-class/
+// http://blog.velir.com/index.php/2011/02/17/ilistt-sorting-a-better-way/
+ [SetUp]
+ public void CreateList() {
+ var contributorList = new ContributorsList();
+ list = contributorList.ContributorCollection;
+ }
+ }
+}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/DataSource/ContributorsList.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/DataSource/ContributorsList.cs
new file mode 100644
index 0000000000..365534fb6e
--- /dev/null
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/DataSource/ContributorsList.cs
@@ -0,0 +1,132 @@
+/*
+ * Created by SharpDevelop.
+ * User: Peter Forstmeier
+ * Date: 20.05.2013
+ * Time: 18:09
+ *
+ * To change this template use Tools | Options | Coding | Edit Standard Headers.
+ */
+using System;
+using System.Collections.Generic;
+
+namespace ICSharpCode.Reporting.Test.DataSource
+{
+ ///
+ /// Description of ContributorsList.
+ ///
+ public class ContributorsList
+ {
+ ContributorCollection contributorCollection;
+
+ public ContributorsList()
+ {
+ this.contributorCollection = CreateContributorsList();
+ }
+
+ public ContributorCollection ContributorCollection {
+ get { return contributorCollection; }
+ }
+
+ private ContributorCollection CreateContributorsList () {
+
+ DateTime d1 = new DateTime(2000,11,11);
+ DateTime d2 = new DateTime(2000,01,01);
+ DateTime d3 = new DateTime(2000,12,24);
+
+ ContributorCollection list = new ContributorCollection();
+
+ list.Add(new Contributor("Christoph","Wille","Senior Project Wrangler",17,new DateTime(1960,12,8),"F"));
+ list.Add(new Contributor("Bernhard","Spuida","Senior Project Wrangler",25,new DateTime(1962,2,24),"D"));
+
+
+ list.Add(new Contributor("Daniel","Grunwald","Technical Lead",12,d1,"F"));
+
+ list.Add(new Contributor("Matt","Ward","NUnit",7,d1,"F"));
+ list.Add(new Contributor("David","Srbecky","Debugger",1,d1,"C"));
+ list.Add(new Contributor("Peter","Forstmeier","SharpDevelop.Reports",7,d1,"D"));
+
+ list.Add(new Contributor("Alexander","Zeitler","SharpDevelop.Reports",3,d2,"D"));
+ list.Add(new Contributor("Markus","Palme","Prg.",6,d2,"R"));
+ list.Add(new Contributor("Georg","Brandl","Prg.",5,d2,"R"));
+ list.Add(new Contributor("Roman","Taranchenko","",2,d2,"U"));
+ list.Add(new Contributor("Denis","Erchoff","",13,d2,"U"));
+
+ list.Add(new Contributor("Ifko","Kovacka","",31,d3,"A"));
+ list.Add(new Contributor("Nathan","Allen","",5,d3,"A"));
+ list.Add(new Contributor("Dickon","Field","DBTools",10,d3,"U"));
+
+ list.Add(new Contributor("Troy","Simpson","Prg.",9,d3,"C"));
+ list.Add(new Contributor("David","Alpert","Prg.",6,d3,"C"));
+ return list;
+ }
+ }
+
+ public class ContributorCollection: List
+ {
+ }
+
+ public class Contributor {
+ string last;
+ string first;
+ string job;
+
+ int randomInt;
+ DateTime randomDate;
+
+ public Contributor(string last, string first,string job,int randomInt,DateTime randomDate,string groupItem)
+ {
+ this.last = last;
+ this.first = first;
+ this.job = job;
+ this.randomDate = randomDate;
+ this.randomInt = randomInt;
+ this.GroupItem = groupItem;
+ }
+
+
+ public string Last {
+ get {
+ return last;
+ }
+
+ }
+
+ public string First {
+ get {
+ return first;
+ }
+
+ }
+
+ public string Job {
+ get {
+ return job;
+ }
+ }
+
+ public int RandomInt {
+ get { return randomInt; }
+ }
+
+
+ public DateTime RandomDate {
+ get { return randomDate; }
+ }
+
+ public string GroupItem {get; set;}
+
+ public MyDummyClass DummyClass {get;set;}
+
+ }
+
+ public class MyDummyClass
+ {
+ public MyDummyClass()
+ {
+
+ }
+
+ public string DummyString {get;set;}
+ public int DummyInt {get;set;}
+ }
+}
diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/PageBuilder/ContainerArrangeStrategyFixture.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/PageBuilder/ContainerArrangeStrategyFixture.cs
index 0b3e01fd97..6d850c6b2b 100644
--- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/PageBuilder/ContainerArrangeStrategyFixture.cs
+++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/PageBuilder/ContainerArrangeStrategyFixture.cs
@@ -108,6 +108,7 @@ namespace ICSharpCode.Reporting.Test.PageBuilder
Location = new Point(80,10),
Size = new Size (20,70),
DesiredSize = new Size (20,70),
+ CanGrow = true,
Parent = container
};
return secondItem;
diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/SortColumn.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/SortColumn.cs
index 80bd3d4814..7d7175d4a4 100644
--- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/SortColumn.cs
+++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/SortColumn.cs
@@ -35,25 +35,16 @@ namespace ICSharpCode.Reports.Core
public SortColumn(string columnName, ListSortDirection sortDirection, Type type,bool caseSensitive ):base (columnName,type)
{
- this.caseSensitive = caseSensitive;
- this.sortDirection = sortDirection;
+ this.CaseSensitive = caseSensitive;
+ this.SortDirection = sortDirection;
}
#region properties
- public ListSortDirection SortDirection {
- get {
- return sortDirection;
- }
- set{
- this.sortDirection = value;
- }
- }
- public bool CaseSensitive {
- get {
- return caseSensitive;
- }
- }
+ public ListSortDirection SortDirection {get;set;}
+
+ public bool CaseSensitive {get;set;}
+
#endregion
}
diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/DataManager/ListStrategy/GroupListFixture.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/DataManager/ListStrategy/GroupListFixture.cs
index 8521317946..d33dc22fb5 100644
--- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/DataManager/ListStrategy/GroupListFixture.cs
+++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/DataManager/ListStrategy/GroupListFixture.cs
@@ -149,7 +149,7 @@ namespace ICSharpCode.Reports.Core.Test.DataManager.ListStrategy
var itemDummy = (BaseDataItem)searchCol[0];
var itemLast = (BaseDataItem)searchCol[1];
var itemGroup = (BaseDataItem)searchCol[2];
-// Console.WriteLine ("\t{0} - {1} - {2}",itemDummy.DBValue,itemLast.DBValue,itemGroup.DBValue);
+ Console.WriteLine ("\t{0} - {1} - {2}",itemDummy.DBValue,itemLast.DBValue,itemGroup.DBValue);
Assert.That(itemDummy.DBValue,Is.Not.Empty);
Assert.That(itemLast.DBValue,Is.Not.Empty);
Assert.That(itemGroup.DBValue,Is.Not.Empty);