diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs index f85dbcd31a..ec1b56a655 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs @@ -98,6 +98,12 @@ namespace SharpReportCore { } + + public void DataBind() { + CheckReportColumns(); + this.dataViewStrategy.Bind(); + } + #endregion void InitDataManager (ReportSettings reportSettings,object dataSource) { @@ -300,27 +306,26 @@ namespace SharpReportCore { } - - #region SharpReportCore.IDataContainer interface implementation public object DataSource { get { return this.dataSource; } } - + /* public int CurrentRow { get { return this.dataViewStrategy.CurrentRow; } } - + */ + /* public int Count { get { return this.dataViewStrategy.Count; } } - - + */ + /* public bool HasMoreData { get { if (this.dataViewStrategy.CurrentRow < this.dataViewStrategy.Count ){ @@ -331,12 +336,8 @@ namespace SharpReportCore { } } + */ - public bool DataBind() { - CheckReportColumns(); - this.dataViewStrategy.Bind(); - return true; - } // public void Skip() { // this.dataViewStrategy.CurrentRow ++; @@ -382,7 +383,7 @@ namespace SharpReportCore { throw new NotImplementedException(); } } - #endregion + // Nur zum testen public DataNavigator GetNavigator { @@ -391,14 +392,14 @@ namespace SharpReportCore { } } - #region System.Collections.IEnumerator interface implementation - + + /* public object Current { get { throw new NotImplementedException(); } } - + */ // public void Reset() { // this.dataViewStrategy.Reset(); // } @@ -408,7 +409,6 @@ namespace SharpReportCore { // } - #endregion public bool IsGrouped { get { diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataNavigator.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataNavigator.cs index d955b5ae90..e91fc37bc5 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataNavigator.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataNavigator.cs @@ -15,9 +15,11 @@ namespace SharpReportCore /// Description of DataNavigator. /// - public class DataNavigator{ + public class DataNavigator :IDataNavigator{ IDataViewStrategy store; public event EventHandler ListChanged; + + public DataNavigator(IDataViewStrategy store){ this.store = store; this.store.ListChanged += new EventHandler (OnListChanged); @@ -35,6 +37,18 @@ namespace SharpReportCore } } + + public bool HasMoreData { + get { + if (this.CurrentRow < this.Count ){ + return true; + } else { + return false; + } + } + } + + /// /// Indicate's if the current has ChildRows /// @@ -45,11 +59,11 @@ namespace SharpReportCore } public int CurrentRow { - get {return store.CurrentRow;} + get {return this.store.CurrentRow;} } public int Count { - get {return store.Count;} + get {return this.store.Count;} } public bool MoveNext () { @@ -57,12 +71,12 @@ namespace SharpReportCore } public void Reset() { - store.Reset(); + this.store.Reset(); } public object Current { get { - return store.Current; + return this.store.Current; } } } diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Interfaces/IDataContainer.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Interfaces/IDataContainer.cs deleted file mode 100644 index 36469050d5..0000000000 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Interfaces/IDataContainer.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Created by SharpDevelop. - * User: Forstmeier Peter - * Date: 08.10.2005 - * Time: 17:03 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ - -namespace SharpReportCore { - public interface IDataContainer { - /// - /// Setup the Databinding, return true if databinding was ok - /// - bool DataBind(); -// /// -// /// Move to next row -// /// -// /// -// void Skip(); - /// - /// reste Datasource,move to position 0 - /// - void Reset (); - -// /// -// /// Reads one row of data and fill the -// /// -// void FetchData (ReportItemCollection collection); - - int Count { - get; - } - /// - /// Get the Position in List - /// - int CurrentRow { - get; - } - /// - /// Returns true when there are more Data to Read, false if we are on the end - /// or the list is empty - /// - bool HasMoreData { - get; - } - - /// - /// Set/read a valid FilterString, - /// - string Filter { - get;set; - } - - } -} diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Interfaces/IDataNavigator.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Interfaces/IDataNavigator.cs new file mode 100644 index 0000000000..82188c8c4a --- /dev/null +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Interfaces/IDataNavigator.cs @@ -0,0 +1,42 @@ +/* + * Created by SharpDevelop. + * User: Forstmeier Peter + * Date: 08.10.2005 + * Time: 17:03 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ +using System; +using System.Collections; +using System.ComponentModel; + + namespace SharpReportCore { + public interface IDataNavigator { + + void Fill (ReportItemCollection collection); + bool MoveNext () ; + void Reset(); + + bool HasMoreData { + get; + } + + bool HasChilds { + get; + } + + int CurrentRow { + get; + } + + int Count { + get; + } + + object Current { + get; + } + + event EventHandler ListChanged; + } + } diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs index 77c3e3cf4d..1dddea14eb 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs @@ -222,6 +222,8 @@ namespace SharpReportCore { if (!String.IsNullOrEmpty(baseDataItem.FormatString)) { rpea.FormatedValue = defaultFormatter.FormatItem (baseDataItem); System.Console.WriteLine("\tFormated Value = {0}",rpea.FormatedValue); + } else { + rpea.FormatedValue = rpea.ValueToFormat; } } } diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs index f6305e89e5..52df7c8ad6 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs @@ -125,13 +125,14 @@ namespace SharpReportCore { // DebugRectangle (e,detailRect); // no loop if there is no data - if (! base.DataManager.HasMoreData ) { + System.Console.WriteLine("Navi hasMore {0}",this.dataNavigator.HasMoreData); + if (! this.dataNavigator.HasMoreData ) { e.PrintPageEventArgs.HasMorePages = false; return; } - while (dataNavigator.MoveNext()) { - dataNavigator.Fill (base.CurrentSection.Items); + while (this.dataNavigator.MoveNext()) { + this.dataNavigator.Fill (base.CurrentSection.Items); base.RenderSection (section,e); section.SectionOffset = section.SectionOffset + section.Size.Height + 2 * base.Gap; diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj b/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj index db99fa6889..02921400a3 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj @@ -80,7 +80,6 @@ - @@ -131,6 +130,7 @@ +