From 64c2f0dbf556709534ceceacb725f6cc58cd4ee2 Mon Sep 17 00:00:00 2001 From: Peter Forstmeier Date: Wed, 11 Dec 2013 20:51:31 +0100 Subject: [PATCH] Grouping --- SharpDevelop.Tests.sln | 2 +- .../Src/PageBuilder/DataPageBuilder.cs | 2 - .../ICSharpCode.Reporting.Test.csproj | 4 + .../src/Reportingfactory/GroupedPushModel.cs | 37 +++ .../src/TestHelper.cs | 18 +- .../src/TestReports/GroupedList.srd | 213 ++++++++++++++++++ 6 files changed, 267 insertions(+), 9 deletions(-) create mode 100644 src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Reportingfactory/GroupedPushModel.cs create mode 100644 src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/TestReports/GroupedList.srd diff --git a/SharpDevelop.Tests.sln b/SharpDevelop.Tests.sln index ab85ecccf7..cf776a8f20 100644 --- a/SharpDevelop.Tests.sln +++ b/SharpDevelop.Tests.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 -# SharpDevelop 4.3 +# SharpDevelop 4.4 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{256F5C28-532C-44C0-8AB8-D8EC5E492E01}" ProjectSection(SolutionItems) = postProject EndProjectSection diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs index d3907ec83c..6db1975750 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs @@ -76,7 +76,6 @@ namespace ICSharpCode.Reporting.PageBuilder InsertExportRows(exportRows); MeasureAndArrangeContainer(row); exportRows.Clear(); -// ExpressionVisitor.Visit(CurrentPage); CurrentPage.PageInfo.PageNumber = Pages.Count + 1; Pages.Add(CurrentPage); @@ -90,7 +89,6 @@ namespace ICSharpCode.Reporting.PageBuilder } row.ExportedItems.AddRange(convertedItems); -// ExpressionVisitor.Visit(row as ExportContainer); exportRows.Add(row); position = new Point(CurrentSection.Location.X,position.Y + row.DesiredSize.Height + 1); } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj index 5e8b7312c7..a12e3cfb43 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj @@ -87,6 +87,7 @@ + @@ -122,5 +123,8 @@ + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Reportingfactory/GroupedPushModel.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Reportingfactory/GroupedPushModel.cs new file mode 100644 index 0000000000..30059bfeb5 --- /dev/null +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Reportingfactory/GroupedPushModel.cs @@ -0,0 +1,37 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Reflection; +using ICSharpCode.Reporting.Interfaces; +using ICSharpCode.Reporting.PageBuilder; +using ICSharpCode.Reporting.Test.DataSource; +using NUnit.Framework; + +namespace ICSharpCode.Reporting.Test.Reportingfactory +{ + [TestFixture] + public class GroupedPushModel + { + IReportCreator reportCreator; + + [Test] + public void TestMethod() + { + Assert.That("a",Is.EqualTo("b")); + } + + [SetUp] + public void LoadFromStream() + { + var contributorList = new ContributorsList(); + var list = contributorList.ContributorCollection; + + var asm = Assembly.GetExecutingAssembly(); + var stream = asm.GetManifestResourceStream(TestHelper.GroupedList); + + var reportingFactory = new ReportingFactory(); + var model = reportingFactory.LoadReportModel (stream); + reportCreator = new DataPageBuilder(model,list); + } + } +} diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/TestHelper.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/TestHelper.cs index 8f9c30d645..2f5e278cd4 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/TestHelper.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/TestHelper.cs @@ -18,11 +18,12 @@ namespace ICSharpCode.Reporting.Test /// public static class TestHelper { - private const string nameSpace = "ICSharpCode.Reporting.Test.src.TestReports."; - private const string plainReportName = "PlainModel.srd"; - private const string withTwoItems = "ReportWithTwoItems.srd"; - private const string fromList = "FromList.srd"; - private const string globalsTestReport = "TestForGlobals.srd"; + const string nameSpace = "ICSharpCode.Reporting.Test.src.TestReports."; + const string plainReportName = "PlainModel.srd"; + const string withTwoItems = "ReportWithTwoItems.srd"; + const string fromList = "FromList.srd"; + const string groupedList = "GroupedList.srd"; + const string globalsTestReport = "TestForGlobals.srd"; public static string PlainReportFileName{ get{return nameSpace + plainReportName;} @@ -38,10 +39,16 @@ namespace ICSharpCode.Reporting.Test get {return nameSpace + fromList;} } + public static string GroupedList { + get {return nameSpace + groupedList;} + } + public static string TestForGlobals { get {return nameSpace + globalsTestReport;} } + + public static void ShowDebug(IExportContainer exportContainer) { var visitor = new DebugVisitor(); @@ -55,7 +62,6 @@ namespace ICSharpCode.Reporting.Test } ShowDebug(container); } else { -// var b = item as IAcceptor; if (acceptor != null) { acceptor.Accept(visitor); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/TestReports/GroupedList.srd b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/TestReports/GroupedList.srd new file mode 100644 index 0000000000..73a17b2c9d --- /dev/null +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/TestReports/GroupedList.srd @@ -0,0 +1,213 @@ + + + + + Report1 + DataReport + 50 + 50 + 50 + 50 + 827, 1169 + False + Millimeter + 5, 5, 5, 5 + + + + + + + + Text + PushData + No Data for this Report + Microsoft Sans Serif, 10pt + True + + + + + 50, 50 + 727, 60 + White + 0 + 0 + False + False + + + 313, 5 + 100, 20 + White + Microsoft Sans Serif, 10pt + None + TopLeft + False + False + System.String + No + Report1 + False + Black + Black + Report1 + + + Black + ReportHeader + + + 50, 125 + 727, 60 + White + 0 + 0 + False + False + + Black + ReportPageHeader + + + 50, 200 + 727, 100 + LightGray + 0 + 0 + False + False + + + 38, 20 + 473, 30 + White + False + ControlText + Black + + + 21, 4 + 100, 20 + White + Segoe UI, 9pt + None + TopLeft + False + False + No + BaseDataItem3 + False + Black + ControlText + GoupItem + BaseDataItem3 + + + + 0 + False + GroupHeader1 + + + 289, 56 + 100, 20 + White + Segoe UI, 9pt + #,##0.00 + None + MiddleRight + False + False + System.Decimal + No + BaseDataItem2 + False + Black + ControlText + RandomInt + BaseDataItem2 + + + 75, 56 + 100, 20 + White + Microsoft Sans Serif, 10pt + None + TopLeft + False + False + System.String + No + BaseDataItem1 + False + Black + Black + Firstname + BaseDataItem1 + + + LightGray + ReportDetail + + + 50, 315 + 727, 60 + White + 0 + 0 + False + False + + + 622, 5 + 100, 20 + White + Microsoft Sans Serif, 10pt + None + TopLeft + False + False + System.String + No + =Globals!PageNumber + False + Black + Black + PageNumber1 + + + Black + ReportPageFooter + + + 50, 390 + 727, 60 + White + 0 + 0 + False + False + + + 298, 4 + 100, 20 + White + Segoe UI, 9pt + None + TopLeft + False + False + No + = sum('RandomInt') + False + Black + ControlText + BaseTextItem2147483646 + + + Black + ReportFooter + + + \ No newline at end of file