Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Remove unused code, introduce IPageInfo interface for better handling…
Browse files Browse the repository at this point in the history
… of Pageinfos in evaluator
  • Loading branch information
PeterForstmeier committed Sep 25, 2010
1 parent ad38116 commit 2fe7c0c
Show file tree
Hide file tree
Showing 21 changed files with 96 additions and 75 deletions.
Expand Up @@ -77,6 +77,7 @@
</Compile>
<Compile Include="Project\BaseClasses\CurrentItem.cs" />
<Compile Include="Project\BaseClasses\GroupColumn.cs" />
<Compile Include="Project\BaseClasses\PageInfo.cs" />
<Compile Include="Project\BaseClasses\Printing\Layouter.cs" />
<Compile Include="Project\BaseClasses\Printing\MeasurementService.cs" />
<Compile Include="Project\BaseClasses\Printing\PrintHelper.cs" />
Expand Down
@@ -0,0 +1,64 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 25.09.2010
* Time: 19:42
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections;

namespace ICSharpCode.Reports.Core.BaseClasses
{
/// <summary>
/// Description of PageInfo.
/// </summary>
public class PageInfo
{

private Hashtable parameterHash;


public PageInfo(int pageNumber)
{
this.PageNumber = pageNumber;
}

public int PageNumber {get;set;}


public int TotalPages {get;set;}


public string ReportName {get;set;}


public string ReportFileName {get;set;}


public string ReportFolder {
get{
return System.IO.Path.GetDirectoryName(this.ReportFileName);
}
}



public DateTime ExecutionTime {get;set;}


public Hashtable ParameterHash{
get{
if (this.parameterHash == null) {
this.parameterHash = new Hashtable();
}
return parameterHash;
}
set {this.parameterHash = value;}
}


public IDataNavigator IDataNavigator {get;set;}
}
}
Expand Up @@ -114,8 +114,6 @@ public static bool IsRoomForFooter(SectionBounds sectionBounds,Point loc)

public static void InitPage (ISinglePage singlePage,ReportSettings reportSettings)
{
singlePage.StartRow = -1;
singlePage.EndRow = -1;
singlePage.ReportFileName = reportSettings.FileName;
singlePage.ReportName = reportSettings.ReportName;
singlePage.ParameterHash = reportSettings.ParameterCollection.CreateHash();
Expand Down
Expand Up @@ -8,7 +8,8 @@
using System;
using System.Drawing;

namespace ICSharpCode.Reports.Core{
namespace ICSharpCode.Reports.Core.BaseClasses
{
/// <summary>
/// Description of Page.
/// </summary>
Expand All @@ -25,7 +26,6 @@ public interface ISectionBounds
Point DetailEnds {get;}
Rectangle DetailArea {get;}
Size PageSize {get;set;}
//int Gap {get;}
bool Landscape{get;}
}

Expand Down
Expand Up @@ -10,18 +10,19 @@
using System.Collections;
using ICSharpCode.Reports.Core.Interfaces;

namespace ICSharpCode.Reports.Core
namespace ICSharpCode.Reports.Core.BaseClasses
{
/// <summary>
/// Description of AbstractPage.
/// </summary>
public class SinglePage : ISinglePage
public class SinglePage :PageInfo, ISinglePage
{

private SectionBounds sectionBounds;
private Hashtable parameterHash;


public SinglePage(SectionBounds sectionBounds, int pageNumber)
public SinglePage(SectionBounds sectionBounds, int pageNumber):base(pageNumber)

{
if (sectionBounds == null) {
throw new ArgumentNullException("sectionBounds");
Expand Down Expand Up @@ -66,47 +67,5 @@ public void CalculatePageBounds(IReportModel reportModel)
set { this.sectionBounds = value; }
}


public int StartRow {get;set;}


public int EndRow {get;set;}


public int PageNumber {get;set;}


public int TotalPages {get;set;}


public string ReportName {get;set;}


public string ReportFileName {get;set;}


public string ReportFolder {
get{
return System.IO.Path.GetDirectoryName(this.ReportFileName);
}
}



public DateTime ExecutionTime {get;set;}


public Hashtable ParameterHash{
get{
if (this.parameterHash == null) {
this.parameterHash = new Hashtable();
}
return parameterHash;
}
set {this.parameterHash = value;}
}


public IDataNavigator IDataNavigator {get;set;}
}
}
Expand Up @@ -9,6 +9,7 @@

using System;
using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces;
using ICSharpCode.Reports.Expressions.ReportingLanguage;
Expand Down
Expand Up @@ -8,6 +8,7 @@
*/
using System;
using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Events;
using ICSharpCode.Reports.Core.Interfaces;
Expand Down
Expand Up @@ -54,9 +54,6 @@ private DataPageBuilder (IReportModel reportModel,IDataManager dataManager,ILayo
protected override void BuildNewPage ()
{
base.BuildNewPage();
if (this.dataNavigator != null) {
this.SinglePage.StartRow = this.dataNavigator.CurrentRow +1;
}

this.BuildReportHeader();
this.BuildPageHeader();
Expand All @@ -65,18 +62,9 @@ protected override void BuildNewPage ()
#endregion


private void SetPageFull()
{
if (this.dataNavigator != null) {
this.SinglePage.EndRow = this.dataNavigator.CurrentRow;
}
}


private void OnPageFull(object sender, NewPageEventArgs e)
{
this.SinglePage.Items.AddRange(e.ItemsList);
SetPageFull();
PageBreak();
}

Expand Down Expand Up @@ -140,7 +128,6 @@ protected void BuildDetail (BaseSection section,IDataNavigator dataNavigator)
convertedList = baseConverter.Convert(section,item);

base.SinglePage.Items.AddRange(convertedList);
SetPageFull();
}
}
}
Expand Down
Expand Up @@ -6,6 +6,7 @@
// </file>

using System;
using ICSharpCode.Reports.Core.BaseClasses;

namespace ICSharpCode.Reports.Core.Exporter
{
Expand Down
Expand Up @@ -7,8 +7,8 @@
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;

using ICSharpCode.Reports.Core;
using ICSharpCode.Reports.Core.BaseClasses;
using ICSharpCode.Reports.Core.Interfaces;
using SimpleExpressionEvaluator.Compilation.Functions.AggregateFunctions;
using SimpleExpressionEvaluator.Utilities;
Expand Down
Expand Up @@ -8,6 +8,7 @@
*/
using System;
using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses;
using ICSharpCode.Reports.Core.Events;
using ICSharpCode.Reports.Core.Exporter;

Expand Down
Expand Up @@ -9,18 +9,13 @@

using System;
using ICSharpCode.Reports.Core;
using ICSharpCode.Reports.Core.BaseClasses;

namespace ICSharpCode.Reports.Core.Interfaces
{
public interface ISinglePage

public interface IPageInfo
{
void CalculatePageBounds(IReportModel reportModel);


SectionBounds SectionBounds {get;set;}

int StartRow {get;set;}
int EndRow {get;set;}
int PageNumber {get;set;}
int TotalPages {get;set;}
string ReportName {get;set;}
Expand All @@ -30,4 +25,11 @@ public interface ISinglePage
System.Collections.Hashtable ParameterHash {get;set;}
IDataNavigator IDataNavigator {get;set;}
}


public interface ISinglePage:IPageInfo
{
void CalculatePageBounds(IReportModel reportModel);
SectionBounds SectionBounds {get;set;}
}
}
Expand Up @@ -72,7 +72,6 @@ protected void RenderTable (BaseReportItem parent,ITableContainer tableContainer
this.CurrentSection.Location.Y);
tableContainer.Items.SortByLocation();

rpea.SinglePage.StartRow = this.dataNavigator.CurrentRow;
Size rs = Size.Empty;

foreach (BaseRowItem row in tableContainer.Items)
Expand Down Expand Up @@ -106,7 +105,6 @@ protected void RenderTable (BaseReportItem parent,ITableContainer tableContainer
do {
if (PrintHelper.IsPageFull(new Rectangle(currentPosition,row.Size),this.SectionBounds)) {
tableContainer.Location = saveLocation;
rpea.SinglePage.EndRow = this.dataNavigator.CurrentRow;
AbstractRenderer.PageBreak(rpea);
return;
}
Expand Down
Expand Up @@ -11,6 +11,7 @@
using System.Drawing.Printing;
using System.Globalization;

using ICSharpCode.Reports.Core.BaseClasses;
using ICSharpCode.Reports.Core.BaseClasses.Printing;
using ICSharpCode.Reports.Core.Interfaces;
using ICSharpCode.Reports.Expressions.ReportingLanguage;
Expand Down
Expand Up @@ -9,6 +9,7 @@

using System;
using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses;
using ICSharpCode.Reports.Core.Test.TestHelpers;
using NUnit.Framework;

Expand Down
Expand Up @@ -9,6 +9,7 @@

using System;
using System.Drawing;
using ICSharpCode.Reports.Core.BaseClasses;
using ICSharpCode.Reports.Core.Interfaces;
using NUnit.Framework;

Expand Down
Expand Up @@ -10,11 +10,12 @@
using System;
using System.Data;
using System.Windows.Forms;
using System.Xml;

using ICSharpCode.Reports.Core.BaseClasses;
using ICSharpCode.Reports.Core.Test.TestHelpers;
using ICSharpCode.Reports.Expressions.ReportingLanguage;
using NUnit.Framework;
using System.Xml;

namespace ICSharpCode.Reports.Core.Test.ReportingLanguage.IntegrationTests
{
Expand Down
Expand Up @@ -9,6 +9,7 @@

using System;
using System.Data;
using ICSharpCode.Reports.Core.BaseClasses;
using ICSharpCode.Reports.Core.Test.TestHelpers;
using ICSharpCode.Reports.Expressions.ReportingLanguage;
using NUnit.Framework;
Expand Down
Expand Up @@ -9,6 +9,7 @@

using System;
using System.Data;
using ICSharpCode.Reports.Core.BaseClasses;
using ICSharpCode.Reports.Core.Test.TestHelpers;
using ICSharpCode.Reports.Expressions.ReportingLanguage;
using NUnit.Framework;
Expand Down
Expand Up @@ -8,6 +8,7 @@
*/

using System;
using ICSharpCode.Reports.Core.BaseClasses;
using ICSharpCode.Reports.Expressions.ReportingLanguage;
using NUnit.Framework;
using SimpleExpressionEvaluator;
Expand Down
Expand Up @@ -7,6 +7,7 @@
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
*/
using System;
using ICSharpCode.Reports.Core.BaseClasses;

namespace ICSharpCode.Reports.Core.Test.ReportingLanguage
{
Expand Down

0 comments on commit 2fe7c0c

Please sign in to comment.