diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportRootDesigner.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportRootDesigner.cs index 993ecf9aac..d140b31d99 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportRootDesigner.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportRootDesigner.cs @@ -260,15 +260,15 @@ namespace ICSharpCode.Reports.Addin.Designer private void OnComponentChanged(object sender, ComponentChangedEventArgs ce) { - System.Console.WriteLine("RootDesigner:OnComponentChanged {0} from {1} to {2}",ce.Component.ToString(),ce.OldValue,ce.NewValue); + LoggingService.InfoFormatted("RootDesigner:OnComponentChanged"); + String str = String.Format("RootDesigner:OnComponentChanged <{0}> from <{1}> to <{2}>",ce.Component.ToString(),ce.OldValue,ce.NewValue); + LoggingService.InfoFormatted(str); - LoggingService.Debug("RootDesigner:OnComponentChanged"); AbstractItem item = ce.Component as AbstractItem; - if (item != null) { - item.Name = ce.NewValue.ToString(); + if ((item != null) && (ce.NewValue != null)) { + item.Name = ce.NewValue.ToString(); } - BaseSection section = ce.Component as BaseSection; if (section != null) { foreach (BaseSection s in sections) diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Collections/Collections.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Collections/Collections.cs index b7abce5c7f..c4ab786efd 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Collections/Collections.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Collections/Collections.cs @@ -197,9 +197,8 @@ namespace ICSharpCode.Reports.Core{ [Serializable()] -// public class SortColumnCollection: Collection{ public class SortColumnCollection: ColumnCollection - { + { public SortColumnCollection() { } @@ -234,13 +233,20 @@ namespace ICSharpCode.Reports.Core{ [Serializable()] - public class GroupColumnCollection: SortColumnCollection { public GroupColumnCollection() { } + public AbstractColumn Find (string columnName) + { + if (String.IsNullOrEmpty(columnName)) { + throw new ArgumentNullException("columnName"); + } + + return this.FirstOrDefault(x => 0 == String.Compare(x.ColumnName,columnName,true)); + } } diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListStrategy/BaseListStrategy.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListStrategy/BaseListStrategy.cs index f5c334dd03..5ecc131b2d 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListStrategy/BaseListStrategy.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListStrategy/BaseListStrategy.cs @@ -62,21 +62,6 @@ namespace ICSharpCode.Reports.Core { #endregion - - protected static Collection CreateSortCollection (SortColumnCollection items) - { - - Collection abstrCol = new Collection(); - foreach(SortColumn sc in items) - { - abstrCol.Add(sc); - } - return abstrCol; - - } - - - public IndexList IndexList { get { diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportSettings.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportSettings.cs index 7d953bffca..498a526a2a 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportSettings.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportSettings.cs @@ -49,7 +49,7 @@ namespace ICSharpCode.Reports.Core{ private ParameterCollection parameterCollection; private AvailableFieldsCollection availableFields; - private ColumnCollection groupingsCollection; + private GroupColumnCollection groupingsCollection; private SortColumnCollection sortingCollection; @@ -104,7 +104,7 @@ namespace ICSharpCode.Reports.Core{ this.RightMargin = GlobalValues.DefaultPageMargin.Right; this.availableFields = new AvailableFieldsCollection(); - this.groupingsCollection = new ColumnCollection(); + this.groupingsCollection = new GroupColumnCollection(); this.sortingCollection = new SortColumnCollection(); this.parameterCollection = new ParameterCollection(); this.NoDataMessage = "No Data for this Report"; @@ -230,7 +230,7 @@ namespace ICSharpCode.Reports.Core{ [Category("Sorting/Grouping")] - public ColumnCollection GroupColumnsCollection { + public GroupColumnCollection GroupColumnsCollection { get { return groupingsCollection; }