Browse Source

Add UnitTest's for Grouping, general cleanup

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/reports@6019 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Peter Forstmeier 16 years ago
parent
commit
81b983f091
  1. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/ICSharpCode.Reports.Core.csproj
  2. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/Layouter.cs
  3. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/MeasurementService.cs
  4. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/PrintHelper.cs
  5. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardFormatter.cs
  6. 16
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardPrinter.cs
  7. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseDataItem.cs
  8. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseReportItem.cs
  9. 13
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseRowItem.cs
  10. 7
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTextItem.cs
  11. 17
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseRectangleItem.cs
  12. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/DataNavigator.cs
  13. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListHandling/IndexList.cs
  14. 74
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListStrategy/BaseListStrategy.cs
  15. 6
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListStrategy/CollectionStrategy.cs
  16. 65
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListStrategy/TableStrategy.cs
  17. 263
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataSource/ReportDataSource.cs
  18. 7
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/AbstractExportListBuilder.cs
  19. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Factories/RendererFactory.cs
  20. 8
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Interfaces/IDataNavigator.cs
  21. 6
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Interfaces/IDataViewStrategy.cs
  22. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/Graphics/BaseShape.cs
  23. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/RenderDataReport.cs
  24. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/RenderFormSheetReport.cs
  25. 3
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportEngine.cs
  26. 7
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportSettings.cs
  27. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportViewer/ReportViewer.cs
  28. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/Converters/RowConverter.cs
  29. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/Converters/TableConverter.cs
  30. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/DataPageBuilder.cs
  31. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/BaseClasses/LayouterFixture.cs
  32. 87
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/DataManager/GroupTableFixture.cs
  33. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/DataManager/IListDataManagerFixture.cs
  34. 4
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/DataManager/TableDataManagerFixture.cs
  35. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/Exporter/DataPageBuilderFixture.cs
  36. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/ICSharpCode.Reports.Core.Test.csproj
  37. 41
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/TestHelpers/ContributorsList.cs

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/ICSharpCode.Reports.Core.csproj

@ -104,7 +104,6 @@
<Compile Include="Project\DataManager\ListStrategy\BaseListStrategy.cs" /> <Compile Include="Project\DataManager\ListStrategy\BaseListStrategy.cs" />
<Compile Include="Project\DataManager\ListStrategy\CollectionStrategy.cs" /> <Compile Include="Project\DataManager\ListStrategy\CollectionStrategy.cs" />
<Compile Include="Project\DataManager\DataManager.cs" /> <Compile Include="Project\DataManager\DataManager.cs" />
<Compile Include="Project\DataSource\ReportDataSource.cs" />
<Compile Include="Project\Dialogs\EditorDialog.cs"> <Compile Include="Project\Dialogs\EditorDialog.cs">
</Compile> </Compile>
<Compile Include="Project\Dialogs\EditorDialog.Designer.cs" /> <Compile Include="Project\Dialogs\EditorDialog.Designer.cs" />

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/Layouter.cs

@ -14,7 +14,7 @@ using System.Linq;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;
namespace ICSharpCode.Reports.Core namespace ICSharpCode.Reports.Core.BaseClasses.Printing
{ {
/// <summary> /// <summary>
/// Description of Layouter. /// Description of Layouter.

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/MeasurementService.cs

@ -9,7 +9,7 @@ using System;
using System.Drawing; using System.Drawing;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;
namespace ICSharpCode.Reports.Core namespace ICSharpCode.Reports.Core.BaseClasses.Printing
{ {
/// <summary> /// <summary>
/// Description of MeasurementService. /// Description of MeasurementService.

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/PrintHelper.cs

@ -16,7 +16,7 @@ using ICSharpCode.Reports.Core.Interfaces;
using ICSharpCode.Reports.Core.old_Exporter; using ICSharpCode.Reports.Core.old_Exporter;
using ICSharpCode.Reports.Expressions.ReportingLanguage; using ICSharpCode.Reports.Expressions.ReportingLanguage;
namespace ICSharpCode.Reports.Core namespace ICSharpCode.Reports.Core.BaseClasses.Printing
{ {
public sealed class PrintHelper public sealed class PrintHelper
{ {

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardFormatter.cs

@ -12,7 +12,7 @@ using System.Globalization;
/// This Class handles the formatting of Output Values depending on there /// This Class handles the formatting of Output Values depending on there
/// Type and DbValue /// Type and DbValue
/// </summary> /// </summary>
namespace ICSharpCode.Reports.Core namespace ICSharpCode.Reports.Core.BaseClasses.Printing
{ {
internal static class StandardFormatter internal static class StandardFormatter
{ {

16
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardPrinter.cs

@ -33,13 +33,16 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
} }
public static void FillBackground (Graphics graphics,BaseStyleDecorator decorator,Rectangle rectangle) public static void FillBackground (Graphics graphics,BaseStyleDecorator decorator)
{ {
RectangleShape backgroundShape = new RectangleShape(); if (decorator.BackColor != GlobalValues.DefaultBackColor) {
backgroundShape.FillShape(graphics, RectangleShape backgroundShape = new RectangleShape();
new SolidFillPattern(decorator.BackColor),
rectangle); backgroundShape.FillShape(graphics,
new SolidFillPattern(decorator.BackColor),
decorator.DisplayRectangle);
}
} }
@ -54,7 +57,6 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
} }
Border border = new Border(new BaseLine (decorator.FrameColor,System.Drawing.Drawing2D.DashStyle.Solid,1)); Border border = new Border(new BaseLine (decorator.FrameColor,System.Drawing.Drawing2D.DashStyle.Solid,1));
Console.WriteLine("\t border {0}",decorator.DisplayRectangle);
border.DrawBorder(graphics,decorator.DisplayRectangle); border.DrawBorder(graphics,decorator.DisplayRectangle);
} }
} }

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseDataItem.cs

@ -10,6 +10,7 @@ using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Xml.Serialization; using System.Xml.Serialization;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.old_Exporter; using ICSharpCode.Reports.Core.old_Exporter;
/// <summary> /// <summary>

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseReportItem.cs

@ -89,7 +89,7 @@ namespace ICSharpCode.Reports.Core {
protected void FillBackground (Graphics graphics) protected void FillBackground (Graphics graphics)
{ {
StandardPrinter.FillBackground(graphics,this.BaseStyleDecorator,this.DrawingRectangle); StandardPrinter.FillBackground(graphics,this.BaseStyleDecorator);
} }

13
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseRowItem.cs

@ -67,17 +67,8 @@ namespace ICSharpCode.Reports.Core{
base.Render(rpea); base.Render(rpea);
StandardPrinter.AdjustBackColor(this); StandardPrinter.AdjustBackColor(this);
if (this.BackColor != GlobalValues.DefaultBackColor) { StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator);
StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator,this.DrawingRectangle);
}
if (this.DrawBorder) {
Console.WriteLine("dec {0} ",BaseStyleDecorator.DisplayRectangle);
Console.WriteLine("rec {0} ",DrawingRectangle);
Console.WriteLine("loc {0} ",this.Location);
Console.WriteLine("--");
}
StandardPrinter.DrawBorder(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator); StandardPrinter.DrawBorder(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator);

7
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTextItem.cs

@ -83,13 +83,8 @@ namespace ICSharpCode.Reports.Core
base.Render(rpea); base.Render(rpea);
if (this.BackColor != GlobalValues.DefaultBackColor) { StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator);
StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator,this.DrawingRectangle);
}
StandardPrinter.DrawBorder(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator); StandardPrinter.DrawBorder(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator);
string formated = StandardFormatter.FormatOutput(this.text,this.FormatString,this.DataType,String.Empty); string formated = StandardFormatter.FormatOutput(this.text,this.FormatString,this.DataType,String.Empty);

17
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseRectangleItem.cs

@ -7,7 +7,9 @@
using System; using System;
using System.Drawing; using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.old_Exporter; using ICSharpCode.Reports.Core.old_Exporter;
/// <summary> /// <summary>
/// This class draws a Rectangle /// This class draws a Rectangle
/// </summary> /// </summary>
@ -45,7 +47,7 @@ namespace ICSharpCode.Reports.Core {
base.Render(rpea); base.Render(rpea);
Rectangle rect = base.DrawingRectangle; Rectangle rect = base.DrawingRectangle;
base.FillBackground(rpea.PrintPageEventArgs.Graphics); StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator);
shape.DrawShape (rpea.PrintPageEventArgs.Graphics, shape.DrawShape (rpea.PrintPageEventArgs.Graphics,
base.Baseline(), base.Baseline(),
rect); rect);
@ -56,18 +58,5 @@ namespace ICSharpCode.Reports.Core {
return "BaseRectangleItem"; return "BaseRectangleItem";
} }
#region System.IDisposable interface implementation
// public override void Dispose() {
// base.Dispose();
// for (int i = 0; i < arrayList.Count;i ++ ) {
// IComponent curObj = (IComponent)arrayList[i];
// curObj.Dispose();
// }
// arrayList = null;
// }
#endregion
} }
} }

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/DataNavigator.cs

@ -64,6 +64,8 @@ namespace ICSharpCode.Reports.Core
public bool IsSorted {get {return this.store.IsSorted;}} public bool IsSorted {get {return this.store.IsSorted;}}
public bool IsGrouped {get {return this.store.IsGrouped;}}
public int CurrentRow { public int CurrentRow {
get {return this.store.CurrentPosition;} get {return this.store.CurrentPosition;}

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListHandling/IndexList.cs

@ -20,7 +20,6 @@ namespace ICSharpCode.Reports.Core
/// <see cref="SharpBaseList"></see> /// <see cref="SharpBaseList"></see>
/// </summary> /// </summary>
public class IndexList :List<BaseComparer> public class IndexList :List<BaseComparer>
// public class IndexList :List<BaseComparer> ,IEnumerable<BaseComparer>
{ {
string name; string name;
int currentPosition; int currentPosition;

74
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListStrategy/BaseListStrategy.cs

@ -49,21 +49,14 @@ namespace ICSharpCode.Reports.Core {
internal abstract class BaseListStrategy :IDataViewStrategy,IEnumerator { internal abstract class BaseListStrategy :IDataViewStrategy,IEnumerator {
private bool isSorted;
// private bool isFiltered;
// private bool isGrouped;
//Index to plain Datat //Index to plain Datat
private IndexList indexList; private IndexList indexList;
private ReportSettings reportSettings; private ReportSettings reportSettings;
private AvailableFieldsCollection availableFields; private AvailableFieldsCollection availableFields;
// private ListChangedEventArgs resetList = new ListChangedEventArgs(ListChangedType.Reset,-1,-1);
// public event EventHandler <ListChangedEventArgs> ListChanged;
// public event EventHandler <GroupChangedEventArgs> GroupChanged;
#region Constructor #region Constructor
protected BaseListStrategy(ReportSettings reportSettings) protected BaseListStrategy(ReportSettings reportSettings)
@ -79,14 +72,7 @@ namespace ICSharpCode.Reports.Core {
#region Event's #region Event's
/*
protected void NotifyResetList()
{
if (this.ListChanged != null) {
this.ListChanged (this,this.resetList);
}
}
*/
/* /*
protected void NotifyGroupChanging (object source,GroupSeparator groupSeperator) protected void NotifyGroupChanging (object source,GroupSeparator groupSeperator)
@ -100,16 +86,16 @@ namespace ICSharpCode.Reports.Core {
#endregion #endregion
protected Collection<AbstractColumn> AbstractCollection protected Collection<AbstractColumn> CreateSortCollection (ColumnCollection items)
{ {
get {
Collection<AbstractColumn> abstrCol = new Collection<AbstractColumn>(); Collection<AbstractColumn> abstrCol = new Collection<AbstractColumn>();
foreach(SortColumn sc in ReportSettings.SortColumnCollection) foreach(SortColumn sc in items)
{ {
abstrCol.Add(sc); abstrCol.Add(sc);
} }
return abstrCol; return abstrCol;
}
} }
public IndexList IndexList public IndexList IndexList
@ -203,10 +189,9 @@ namespace ICSharpCode.Reports.Core {
ListSortDirection sd = scc.SortDirection; ListSortDirection sd = scc.SortDirection;
List<BaseComparer> lbc = null; List<BaseComparer> lbc = null;
if (sd == ListSortDirection.Ascending) { if (sd == ListSortDirection.Ascending) {
// lbc = list.OrderBy(i => i.ObjectArray[0]).ToList();
lbc = list.AsQueryable().AscendingOrder().ToList(); lbc = list.AsQueryable().AscendingOrder().ToList();
} else { } else {
// lbc = list.OrderByDescending(i => i.ObjectArray[0]).ToList();
lbc = list.AsQueryable().DescendingOrder().ToList(); lbc = list.AsQueryable().DescendingOrder().ToList();
} }
return lbc; return lbc;
@ -215,6 +200,17 @@ namespace ICSharpCode.Reports.Core {
#endregion #endregion
protected void ShowIndexList (IndexList list)
{
System.Diagnostics.Trace.WriteLine("Ch listeckIndexList ");
foreach (SortComparer element in list) {
string v = element.ObjectArray[0].ToString();
System.Diagnostics.Trace.WriteLine(v);
System.Console.WriteLine(v);
}
}
/* /*
protected static void CheckSortArray (ExtendedIndexCollection arr,string text) protected static void CheckSortArray (ExtendedIndexCollection arr,string text)
{ {
@ -309,15 +305,11 @@ namespace ICSharpCode.Reports.Core {
} }
public virtual bool IsSorted public virtual bool IsSorted {get;set;}
{
get {
return this.isSorted;
} public bool IsGrouped {get;set;}
set {
this.isSorted = value;
}
}
/* /*
public bool IsFiltered public bool IsFiltered
@ -329,14 +321,9 @@ namespace ICSharpCode.Reports.Core {
} }
} }
*/ */
/*
public bool IsGrouped
{
get {
return this.isGrouped;
}
}
*/
/* /*
protected virtual void Group() protected virtual void Group()
@ -358,6 +345,13 @@ namespace ICSharpCode.Reports.Core {
} }
public virtual void Group()
{
this.indexList.Clear();
this.IsGrouped = true;
}
public virtual void Bind() public virtual void Bind()
{ {

6
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListStrategy/CollectionStrategy.cs

@ -214,12 +214,12 @@ namespace ICSharpCode.Reports.Core {
if ((base.ReportSettings.SortColumnCollection != null)) { if ((base.ReportSettings.SortColumnCollection != null)) {
if (base.ReportSettings.SortColumnCollection.Count > 0) { if (base.ReportSettings.SortColumnCollection.Count > 0) {
base.IndexList = this.BuildSortIndex (base.AbstractCollection); // base.IndexList = this.BuildSortIndex (base.CreateSortCollection());
base.IndexList = this.BuildSortIndex (base.CreateSortCollection(ReportSettings.SortColumnCollection));
base.IsSorted = true; base.IsSorted = true;
// BaseListStrategy.CheckSortArray (base.IndexList,"TableStrategy - CheckSortArray"); // BaseListStrategy.CheckSortArray (base.IndexList,"TableStrategy - CheckSortArray");
} else { } else {
base.IndexList = this.IndexBuilder(base.AbstractCollection); base.IndexList = this.IndexBuilder(base.CreateSortCollection(ReportSettings.SortColumnCollection));
base.IsSorted = false; base.IsSorted = false;
} }
} }

65
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/ListStrategy/TableStrategy.cs

@ -35,7 +35,14 @@ namespace ICSharpCode.Reports.Core
public override void Bind() public override void Bind()
{ {
base.Bind(); base.Bind();
this.Sort ();
if (base.ReportSettings.GroupColumnsCollection.Count > 0) {
this.Group();
} else {
this.Sort ();
}
Reset(); Reset();
} }
@ -82,21 +89,34 @@ namespace ICSharpCode.Reports.Core
base.Reset(); base.Reset();
} }
public override void Sort() public override void Sort()
{ {
base.Sort(); base.Sort();
if ((base.ReportSettings.SortColumnCollection != null)) { if ((base.ReportSettings.SortColumnCollection != null)) {
if (base.ReportSettings.SortColumnCollection.Count > 0) { if (base.ReportSettings.SortColumnCollection.Count > 0) {
base.IndexList = this.BuildSortIndex (base.AbstractCollection); base.IndexList = this.BuildSortIndex (base.CreateSortCollection(ReportSettings.SortColumnCollection));
base.IsSorted = true; base.IsSorted = true;
} else { } else {
// if we have no sorting, we build the indexlist as well // if we have no sorting, we build the indexlist as well
base.IndexList = this.IndexBuilder(base.AbstractCollection); base.IndexList = this.IndexBuilder(ReportSettings.SortColumnCollection);
base.IsSorted = false; base.IsSorted = false;
} }
} }
} }
public override void Group ()
{
base.Group();
IndexList gl = new IndexList("group");
gl = this.BuildSortIndex (base.CreateSortCollection(ReportSettings.GroupColumnsCollection));
base.ShowIndexList(gl);
BuildGroup(gl);
}
#endregion #endregion
@ -136,6 +156,45 @@ namespace ICSharpCode.Reports.Core
} }
private void BuildGroup (IndexList list)
{
string compVal = String.Empty;
base.IndexList.Clear();
foreach (SortComparer element in list)
{
string v = element.ObjectArray[0].ToString();
if (compVal != v) {
// Console.WriteLine("Header {0}",v);
GHeader(element);
GChild(element);
} else {
// Console.WriteLine("\t {0}",v);
GChild(element);
}
compVal = v;
}
Console.WriteLine("-------------------------");
ShowIndexList(base.IndexList);
}
private void GHeader (SortComparer sc)
{
string v = sc.ObjectArray[0].ToString();
Console.WriteLine("");
Console.WriteLine("Header {0}",v);
Console.WriteLine("-----");
base.IndexList.Add(sc);
}
private void GChild(SortComparer sc)
{
string v = sc.ObjectArray[0].ToString();
Console.WriteLine("child {0}",v);
}
private IndexList IndexBuilder(Collection<AbstractColumn> col) private IndexList IndexBuilder(Collection<AbstractColumn> col)
{ {
IndexList arrayList = new IndexList(); IndexList arrayList = new IndexList();

263
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataSource/ReportDataSource.cs

@ -1,263 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Peter Forstmeier" email="peter.forstmeier@t-online.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Globalization;
/// <summary>
/// This Class is used as a wrapper around Databinding
/// </summary>
/// <remarks>
/// created by - Forstmeier Peter
/// created on - 16.10.2005 14:49:43
/// </remarks>
namespace ICSharpCode.Reports.Core {
public class ReportDataSource :IDisposable {
ReportSettings reportSettings;
object dataSource;
ConnectionObject connectionObject;
IDbConnection connection;
/// <summary>
/// use this Constructor for PullDataReports
/// </summary>
/// <param name="connection">A valid connection</param>
/// <param name="reportSettings">a <see cref="ReportSettings"></see></param>
#region Constructores
public static ReportDataSource CreateInstance (ConnectionObject connectionObject, ReportSettings reportSettings)
{
if (connectionObject == null) {
throw new ArgumentNullException("connectionObject");
}
if (reportSettings == null) {
throw new ArgumentNullException("reportSettings");
}
ReportDataSource instance = new ReportDataSource(connectionObject,reportSettings);
return instance;
}
public static ReportDataSource CreateInstance (object dataSource, ReportSettings reportSettings)
{
if (reportSettings == null) {
throw new ArgumentNullException("reportSettings");
}
ReportDataSource instance = new ReportDataSource(dataSource,reportSettings);
return instance;
}
private ReportDataSource(object dataSource, ReportSettings reportSettings)
{
this.dataSource = dataSource;
this.reportSettings = reportSettings;
if (!this.CheckDataSource()) {
throw new MissingDataSourceException();
}
if (this.reportSettings.DataModel != GlobalEnums.PushPullModel.PushData) {
SqlQueryChecker.Check(this.reportSettings.CommandType,this.reportSettings.CommandText);
}
}
private ReportDataSource(ConnectionObject connectionObject, ReportSettings reportSettings)
{
this.connectionObject = connectionObject;
this.reportSettings = reportSettings;
this.connection = connectionObject.Connection;
if (this.connection.State == ConnectionState.Open) {
this.connection.Close();
}
if (this.reportSettings.DataModel != GlobalEnums.PushPullModel.PushData) {
SqlQueryChecker.Check(this.reportSettings.CommandType,this.reportSettings.CommandText);
}
this.dataSource = this.FillDataSet().Tables[0];
CheckDataSource();
/*
this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource,
reportSettings);
this.dataViewStrategy.ListChanged += new EventHandler <ListChangedEventArgs> (NotifyListChanged);
*/
}
#endregion
#region init and some check's
private bool CheckDataSource()
{
DataSet dataSet = this.dataSource as DataSet;
if (dataSet != null) {
return true;
}
DataTable table = this.dataSource as DataTable;
if (table != null) {
return true;
}
//IList
IList list = this.dataSource as IList;
if (list != null) {
return true;
}
return false;
}
#endregion
#region Database
private DataSet FillDataSet()
{
try {
if (this.connection.State == ConnectionState.Closed) {
this.connection.Open();
}
IDbCommand command = this.connection.CreateCommand();
command.CommandText = reportSettings.CommandText;
command.CommandType = reportSettings.CommandType;
// We have to check if there are parameters for this Query, if so
// add them to the command
BuildQueryParameters(command,reportSettings.ParameterCollection);
IDbDataAdapter adapter = connectionObject.CreateDataAdapter(command);
DataSet ds = new DataSet();
ds.Locale = CultureInfo.CurrentCulture;
adapter.Fill (ds);
return ds;
} finally {
if (this.connection.State == ConnectionState.Open) {
this.connection.Close();
}
}
}
public static void BuildQueryParameters (IDbCommand cmd,
ParameterCollection sqlParametersCollection)
{
if (sqlParametersCollection != null && sqlParametersCollection.Count > 0) {
IDbDataParameter dbPar = null;
foreach (SqlParameter rpPar in sqlParametersCollection) {
dbPar = cmd.CreateParameter();
dbPar.ParameterName = rpPar.ParameterName;
if (rpPar.DataType != System.Data.DbType.Binary) {
dbPar.DbType = rpPar.DataType;
dbPar.Value = rpPar.ParameterValue;
} else {
dbPar.DbType = System.Data.DbType.Binary;
}
dbPar.Direction = rpPar.ParameterDirection;
cmd.Parameters.Add(dbPar);
}
}
}
#endregion
#region Event Handling
/*
private void NotifyListChanged (object sender, ListChangedEventArgs e)
{
if (this.ListChanged != null) {
this.ListChanged (this,e);
}
}
*/
/*
private void NotifyGroupChanging () {
if (this.GroupChanging!= null) {
this.GroupChanging (this,EventArgs.Empty);
}
}
private void NotifyGroupChanged() {
if (this.IsGrouped) {
// if (this.GroupChanged != null) {
// this.GroupChanged (this,new GroupChangedEventArgs(this.groupSeperator));
// }
}
}
private void OnGroupChange (object sender,GroupChangedEventArgs e) {
this.NotifyGroupChanging();
}
*/
#endregion
#region Property's
public ReportSettings ReportSettings {
get { return reportSettings; }
}
public ConnectionObject ConnectionObject {
get { return connectionObject; }
}
public object DataSource {
get { return dataSource; }
}
#endregion
#region System.IDisposable interface implementation
public void Dispose() {
this.Dispose(true);
GC.SuppressFinalize(this);
}
~ReportDataSource(){
Dispose(false);
}
protected virtual void Dispose(bool disposing)
{
try {
if (disposing) {
// Free other state (managed objects).
/*
if (this.dataViewStrategy != null) {
this.dataViewStrategy.Dispose();
}
*/
}
} finally {
// Release unmanaged resources.
// Set large fields to null.
// Call Dispose on your base class.
}
}
#endregion
}
}

7
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/AbstractExportListBuilder.cs

@ -7,14 +7,15 @@
* To change this template use Tools | Options | Coding | Edit Standard Headers. * To change this template use Tools | Options | Coding | Edit Standard Headers.
*/ */
using System; using System;
using System.Drawing;
using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Drawing;
using System.Linq;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Exporter.Converter; using ICSharpCode.Reports.Core.Exporter.Converter;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;
namespace ICSharpCode.Reports.Core.Exporter namespace ICSharpCode.Reports.Core.Exporter
{ {
/// <summary> /// <summary>

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Factories/RendererFactory.cs

@ -6,6 +6,7 @@
// </file> // </file>
using System; using System;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;
/// <summary> /// <summary>

8
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Interfaces/IDataNavigator.cs

@ -9,7 +9,8 @@ using System;
using System.ComponentModel; using System.ComponentModel;
namespace ICSharpCode.Reports.Core { namespace ICSharpCode.Reports.Core {
public interface IDataNavigator {
public interface IDataNavigator {
void Fill (ReportItemCollection collection); void Fill (ReportItemCollection collection);
bool MoveNext () ; bool MoveNext () ;
@ -20,13 +21,17 @@ using System.ComponentModel;
bool HasMoreData { bool HasMoreData {
get; get;
} }
/* /*
bool HasChildren { bool HasChildren {
get; get;
} }
*/ */
bool IsSorted {get;} bool IsSorted {get;}
bool IsGrouped {get;}
int CurrentRow { int CurrentRow {
get; get;
} }
@ -43,6 +48,5 @@ using System.ComponentModel;
System.Collections.IEnumerator RangeEnumerator(int start, int end); System.Collections.IEnumerator RangeEnumerator(int start, int end);
// event EventHandler <ListChangedEventArgs> ListChanged;
} }
} }

6
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Interfaces/IDataViewStrategy.cs

@ -14,6 +14,8 @@ namespace ICSharpCode.Reports.Core{
void Sort (); void Sort ();
void Group();
void Bind(); void Bind();
void Fill (IReportItem item); void Fill (IReportItem item);
@ -33,9 +35,11 @@ namespace ICSharpCode.Reports.Core{
bool IsSorted {get;} bool IsSorted {get;}
/* /*
bool IsFiltered{get;} bool IsFiltered{get;}
*/
bool IsGrouped {get;} bool IsGrouped {get;set;}
/*
bool HasChildren {get;} bool HasChildren {get;}
IndexList ChildRows {get;} IndexList ChildRows {get;}

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/Graphics/BaseShape.cs

@ -44,7 +44,7 @@ namespace ICSharpCode.Reports.Core {
#region GDI+ #region GDI+
public void FillShape (Graphics graphics, Brush brush,Rectangle rectangle) private void FillShape (Graphics graphics, Brush brush,Rectangle rectangle)
{ {
if (graphics == null) { if (graphics == null) {
throw new ArgumentNullException("graphics"); throw new ArgumentNullException("graphics");

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/RenderDataReport.cs

@ -8,6 +8,8 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Drawing.Printing; using System.Drawing.Printing;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;
/// <summary> /// <summary>

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/RenderFormSheetReport.cs

@ -8,6 +8,7 @@
using System; using System;
using System.Drawing.Printing; using System.Drawing.Printing;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;
/// <summary> /// <summary>

3
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportEngine.cs

@ -13,8 +13,9 @@ using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml; using System.Xml;
using ICSharpCode.Reports.Core.old_Exporter; using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;
using ICSharpCode.Reports.Core.old_Exporter;
/// <summary> /// <summary>
/// This Class contains the basic Functions to handle reports /// This Class contains the basic Functions to handle reports

7
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportSettings.cs

@ -50,7 +50,7 @@ namespace ICSharpCode.Reports.Core{
private ParameterCollection parameterCollection; private ParameterCollection parameterCollection;
private AvailableFieldsCollection availableFields; private AvailableFieldsCollection availableFields;
private ColumnCollection groupingsCollection; private ColumnCollection groupingsCollection;
private SortColumnCollection sortingCollection; private ColumnCollection sortingCollection;
#region Constructor #region Constructor
@ -105,7 +105,7 @@ namespace ICSharpCode.Reports.Core{
this.availableFields = new AvailableFieldsCollection(); this.availableFields = new AvailableFieldsCollection();
this.groupingsCollection = new ColumnCollection(); this.groupingsCollection = new ColumnCollection();
this.sortingCollection = new SortColumnCollection(); this.sortingCollection = new ColumnCollection();
this.parameterCollection = new ParameterCollection(); this.parameterCollection = new ParameterCollection();
this.NoDataMessage = "No Data for this Report"; this.NoDataMessage = "No Data for this Report";
} }
@ -223,7 +223,8 @@ namespace ICSharpCode.Reports.Core{
/// Get/Set a Collection of <see cref="SortColumn">SortColumn</see> /// Get/Set a Collection of <see cref="SortColumn">SortColumn</see>
/// </summary> /// </summary>
public SortColumnCollection SortColumnCollection {
public ColumnCollection SortColumnCollection {
get {return sortingCollection;} get {return sortingCollection;}
} }

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportViewer/ReportViewer.cs

@ -14,6 +14,7 @@ using System.Drawing.Text;
using System.Globalization; using System.Globalization;
using System.Windows.Forms; using System.Windows.Forms;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;
using ICSharpCode.Reports.Core.old_Exporter; using ICSharpCode.Reports.Core.old_Exporter;
using ICSharpCode.Reports.Core.old_Exporter.ExportRenderer; using ICSharpCode.Reports.Core.old_Exporter.ExportRenderer;

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/Converters/RowConverter.cs

@ -10,6 +10,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;
namespace ICSharpCode.Reports.Core.old_Exporter namespace ICSharpCode.Reports.Core.old_Exporter

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/Converters/TableConverter.cs

@ -8,6 +8,7 @@
*/ */
using System; using System;
using System.Drawing; using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;
namespace ICSharpCode.Reports.Core.old_Exporter namespace ICSharpCode.Reports.Core.old_Exporter

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/old_Exporter/DataPageBuilder.cs

@ -7,6 +7,7 @@
using System; using System;
using System.Drawing; using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Events; using ICSharpCode.Reports.Core.Events;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/BaseClasses/LayouterFixture.cs

@ -9,6 +9,7 @@
using System; using System;
using System.Drawing; using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Test.TestHelpers; using ICSharpCode.Reports.Core.Test.TestHelpers;
using NUnit.Framework; using NUnit.Framework;

87
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/DataManager/GroupTableFixture.cs

@ -0,0 +1,87 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 01.07.2010
* Time: 20:21
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.ComponentModel;
using System.Data;
using ICSharpCode.Reports.Core.Test.TestHelpers;
using NUnit.Framework;
namespace ICSharpCode.Reports.Core.Test.DataManager
{
[TestFixture]
public class GroupTableFixture
{
DataTable table;
[Test]
public void GroupingCollection_Empty_IsGrouped_False()
{
IDataManager dm = ICSharpCode.Reports.Core.DataManager.CreateInstance(this.table,new ReportSettings());
DataNavigator dataNav = dm.GetNavigator;
Assert.That(dataNav.IsGrouped == false);
}
[Test]
public void GroupingCollection_Contains_IsGrouped_False()
{
GroupColumn gc = new GroupColumn("GroupItem",1,ListSortDirection.Ascending);
ReportSettings rs = new ReportSettings();
rs.GroupColumnsCollection.Add(gc);
IDataManager dm = ICSharpCode.Reports.Core.DataManager.CreateInstance(this.table,rs);
DataNavigator dataNav = dm.GetNavigator;
Assert.That(dataNav.IsGrouped == true);
}
[Test]
public void aaAddGroupToSettings ()
{
GroupColumn gc = new GroupColumn("GroupItem",1,ListSortDirection.Ascending);
ReportSettings rs = new ReportSettings();
rs.GroupColumnsCollection.Add(gc);
Assert.AreEqual(1,rs.GroupColumnsCollection.Count);
}
[Test]
public void aaa()
{
IDataManager dm = ICSharpCode.Reports.Core.DataManager.CreateInstance(this.table,new ReportSettings());
DataNavigator dataNav = dm.GetNavigator;
while (dataNav.MoveNext()) {
DataRow r = dataNav.Current as DataRow;
string v2 = r["Groupitem"].ToString();
}
}
[TestFixtureSetUp]
public void Init()
{
ContributorsList contributorsList = new ContributorsList();
this.table = contributorsList.ContributorTable;
}
[TestFixtureTearDown]
public void Dispose()
{
// TODO: Add tear down code.
}
}
}

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/DataManager/IListDataManagerFixture.cs

@ -125,7 +125,7 @@ namespace ICSharpCode.Reports.Core.Test.DataManager
{ {
IDataManager dm = ICSharpCode.Reports.Core.DataManager.CreateInstance(this.contributorCollection,new ReportSettings()); IDataManager dm = ICSharpCode.Reports.Core.DataManager.CreateInstance(this.contributorCollection,new ReportSettings());
DataNavigator dataNav = dm.GetNavigator; DataNavigator dataNav = dm.GetNavigator;
Assert.AreEqual(5,dataNav.AvailableFields.Count); Assert.AreEqual(6,dataNav.AvailableFields.Count);
} }

4
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/DataManager/TableDataManagerFixture.cs

@ -378,8 +378,8 @@ namespace ICSharpCode.Reports.Core.Test.DataManager
Assert.AreEqual(typeof(string),c[0].DataType); Assert.AreEqual(typeof(string),c[0].DataType);
Assert.AreEqual(typeof(string),c[1].DataType); Assert.AreEqual(typeof(string),c[1].DataType);
Assert.AreEqual(typeof(string),c[2].DataType); Assert.AreEqual(typeof(string),c[2].DataType);
Assert.AreEqual(typeof(int),c[3].DataType); Assert.AreEqual(typeof(int),c[4].DataType);
Assert.AreEqual(typeof(DateTime),c[4].DataType); Assert.AreEqual(typeof(DateTime),c[5].DataType);
} }
} }

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/Exporter/DataPageBuilderFixture.cs

@ -9,6 +9,7 @@
using System; using System;
using System.Data; using System.Data;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Exporter; using ICSharpCode.Reports.Core.Exporter;
using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.Reports.Core.Interfaces;
using ICSharpCode.Reports.Core.Project.Interfaces; using ICSharpCode.Reports.Core.Project.Interfaces;

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/ICSharpCode.Reports.Core.Test.csproj

@ -71,6 +71,7 @@
<Compile Include="Collections\ColumnCollectionFixture.cs" /> <Compile Include="Collections\ColumnCollectionFixture.cs" />
<Compile Include="Collections\ParametersCollectionFixture.cs" /> <Compile Include="Collections\ParametersCollectionFixture.cs" />
<Compile Include="Collections\ReportItemCollectionFixture.cs" /> <Compile Include="Collections\ReportItemCollectionFixture.cs" />
<Compile Include="DataManager\GroupTableFixture.cs" />
<Compile Include="DataManager\IConnectionDataManagerFixture.cs" /> <Compile Include="DataManager\IConnectionDataManagerFixture.cs" />
<Compile Include="DataManager\IListDataManagerFixture.cs" /> <Compile Include="DataManager\IListDataManagerFixture.cs" />
<Compile Include="DataManager\MockDataAccess.cs" /> <Compile Include="DataManager\MockDataAccess.cs" />

41
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/TestHelpers/ContributorsList.cs

@ -35,6 +35,7 @@ namespace ICSharpCode.Reports.Core.Test.TestHelpers
t.Columns.Add(new DataColumn("First")); t.Columns.Add(new DataColumn("First"));
t.Columns.Add(new DataColumn("Last")); t.Columns.Add(new DataColumn("Last"));
t.Columns.Add(new DataColumn("Job")); t.Columns.Add(new DataColumn("Job"));
t.Columns.Add(new DataColumn("GroupItem"));
t.Columns.Add(new DataColumn("RandomInt",typeof(int))); t.Columns.Add(new DataColumn("RandomInt",typeof(int)));
t.Columns.Add(new DataColumn("RandomDate",typeof(DateTime))); t.Columns.Add(new DataColumn("RandomDate",typeof(DateTime)));
foreach (Contributor c in this.contributorCollection) { foreach (Contributor c in this.contributorCollection) {
@ -42,6 +43,7 @@ namespace ICSharpCode.Reports.Core.Test.TestHelpers
r["First"] = c.First; r["First"] = c.First;
r["Last"] = c.Last; r["Last"] = c.Last;
r["Job"] = c.Job; r["Job"] = c.Job;
r["GroupItem"] = c.GroupItem;
r["RandomInt"] = c.RandomInt; r["RandomInt"] = c.RandomInt;
r["RandomDate"] = c.RandomDate; r["RandomDate"] = c.RandomDate;
t.Rows.Add(r); t.Rows.Add(r);
@ -54,24 +56,24 @@ namespace ICSharpCode.Reports.Core.Test.TestHelpers
private ContributorCollection CreateContributorsList () { private ContributorCollection CreateContributorsList () {
ContributorCollection list = new ContributorCollection(); ContributorCollection list = new ContributorCollection();
list.Add(new Contributor("Christoph","Wille","Senior Project Wrangler",17,new DateTime(1960,12,8))); 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))); 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,new DateTime(1961,1,30))); list.Add(new Contributor("Daniel","Grunwald","Technical Lead",12,new DateTime(1961,1,30),"F"));
list.Add(new Contributor("Matt","Ward","NUnit",7,new DateTime(62,4,8))); list.Add(new Contributor("Matt","Ward","NUnit",7,new DateTime(62,4,8),"F"));
list.Add(new Contributor("David","Srbecky","Debugger",1,new DateTime(1961,11,19))); list.Add(new Contributor("David","Srbecky","Debugger",1,new DateTime(1961,11,19),"C"));
list.Add(new Contributor("Peter","Forstmeier","SharpDevelop.Reports",7,new DateTime(1962,10,27))); list.Add(new Contributor("Peter","Forstmeier","SharpDevelop.Reports",7,new DateTime(1962,10,27),"D"));
list.Add(new Contributor("Alexander","Zeitler","SharpDevelop.Reports",3,new DateTime(1961,9,9))); list.Add(new Contributor("Alexander","Zeitler","SharpDevelop.Reports",3,new DateTime(1961,9,9),"D"));
list.Add(new Contributor("Markus","Palme","Prg.",6,new DateTime(1960,2,12))); list.Add(new Contributor("Markus","Palme","Prg.",6,new DateTime(1960,2,12),"R"));
list.Add(new Contributor("Georg","Brandl","Prg.",5,new DateTime(2003,8,13))); list.Add(new Contributor("Georg","Brandl","Prg.",5,new DateTime(2003,8,13),"R"));
list.Add(new Contributor("Roman","Taranchenko","",2,new DateTime(2002,6,6))); list.Add(new Contributor("Roman","Taranchenko","",2,new DateTime(2002,6,6),"U"));
list.Add(new Contributor("Denis","Erchoff","",13,new DateTime(1961,5,15))); list.Add(new Contributor("Denis","Erchoff","",13,new DateTime(1961,5,15),"U"));
list.Add(new Contributor("Ifko","Kovacka","",31,new DateTime(1960,4,16))); list.Add(new Contributor("Ifko","Kovacka","",31,new DateTime(1960,4,16),"A"));
list.Add(new Contributor("Nathan","Allen","",5,new DateTime(1962,2,8))); list.Add(new Contributor("Nathan","Allen","",5,new DateTime(1962,2,8),"A"));
list.Add(new Contributor("Dickon","Field","DBTools",10,new DateTime(1961,10,3))); list.Add(new Contributor("Dickon","Field","DBTools",10,new DateTime(1961,10,3),"U"));
list.Add(new Contributor("Troy","Simpson","Prg.",9,new DateTime(1962,5,2))); list.Add(new Contributor("Troy","Simpson","Prg.",9,new DateTime(1962,5,2),"C"));
list.Add(new Contributor("David","Alpert","Prg.",6,new DateTime(2000,5,1))); list.Add(new Contributor("David","Alpert","Prg.",6,new DateTime(2000,5,1),"C"));
return list; return list;
} }
@ -82,16 +84,18 @@ namespace ICSharpCode.Reports.Core.Test.TestHelpers
string last; string last;
string first; string first;
string job; string job;
int randomInt; int randomInt;
DateTime randomDate; DateTime randomDate;
public 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.last = last;
this.first = first; this.first = first;
this.job = job; this.job = job;
this.randomDate = randomDate; this.randomDate = randomDate;
this.randomInt = randomInt; this.randomInt = randomInt;
this.GroupItem = groupItem;
} }
@ -124,6 +128,9 @@ namespace ICSharpCode.Reports.Core.Test.TestHelpers
get { return randomDate; } get { return randomDate; }
} }
public string GroupItem {get; private set;}
} }
public class ContributorCollection: List<Contributor> public class ContributorCollection: List<Contributor>

Loading…
Cancel
Save