diff --git a/src/AddIns/Misc/SharpReport/SharpReport.sln b/src/AddIns/Misc/SharpReport/SharpReport.sln index d569828c3e..ac2b98f762 100644 --- a/src/AddIns/Misc/SharpReport/SharpReport.sln +++ b/src/AddIns/Misc/SharpReport/SharpReport.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 9.00 -# SharpDevelop 2.0.0.1000 +# SharpDevelop 2.0.0.1001 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReportCore", "SharpReportCore\SharpReportCore.csproj", "{4B2239FF-8FD6-431D-9D22-1B8049BA6917}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReport", "SharpReport\SharpReport.csproj", "{F5563727-8309-4AC3-BACA-EB28EFD8A1D0}" diff --git a/src/AddIns/Misc/SharpReport/SharpReport/AutoReport.cs b/src/AddIns/Misc/SharpReport/SharpReport/AutoReport.cs index 46803dcec3..a61202567e 100644 --- a/src/AddIns/Misc/SharpReport/SharpReport/AutoReport.cs +++ b/src/AddIns/Misc/SharpReport/SharpReport/AutoReport.cs @@ -15,15 +15,12 @@ using System.Drawing; using System.Drawing.Printing; using System.Data; -//using ICSharpCode.Core.Services; -//using ICSharpCode.SharpDevelop.Services; - using ICSharpCode.Core; using ICSharpCode.SharpDevelop; using SharpReport; using SharpReportCore; -//using SharpReport.Globals; + using SharpReport.ReportItems; using System.Windows.Forms; diff --git a/src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs b/src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs index d34d0e8780..2008a6cee9 100644 --- a/src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs +++ b/src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs @@ -110,7 +110,17 @@ namespace SharpReport{ } - void AddItemsToSection (BaseSection section,ReportItemCollection collection) { + private AbstractRenderer BuildRenderer (ReportModel model) { + + System.Console.WriteLine("BuildRenderer"); + if (base.ConnectionObject == null) { + base.ConnectionObject = this.BuildConnectionObject(model.ReportSettings); + } + return base.AbstractRenderer(model); + } + + + private void AddItemsToSection (BaseSection section,ReportItemCollection collection) { if ((section == null)|| (collection == null) ) { throw new ArgumentNullException ("Sharpreportmanager:AddItemsToSection"); @@ -309,7 +319,10 @@ namespace SharpReport{ #endregion public AbstractRenderer GetRenderer (ReportModel model) { - return base.AbstractRenderer(model); + if (model == null) { + throw new ArgumentException("SharpReportManager:GetRenderer 'ReportModel'"); + } + return this.BuildRenderer (model); } #region Preview @@ -323,21 +336,13 @@ namespace SharpReport{ try { System.Console.WriteLine("--------------------"); System.Console.WriteLine("Manager:ReportPreview"); - - //Allways check for a valid ConnectionObject - if (base.ConnectionObject == null) { - base.ConnectionObject = this.BuildConnectionObject(baseDesignerControl.ReportModel.ReportSettings); - } - - AbstractRenderer abstr = base.AbstractRenderer(model); + AbstractRenderer abstr = this.BuildRenderer (model); if (abstr != null) { if (abstr.Cancel == false) { if (showInUserControl){ - System.Console.WriteLine("\tShow with UserControl"); PreviewControl.ShowPreviewWithUserControl (abstr,1.5); } else { - System.Console.WriteLine("\tShow wit Dialog"); PreviewControl.ShowPreviewWithDialog (abstr,1.5); } } @@ -428,10 +433,8 @@ namespace SharpReport{ get { if (this.baseDesignerControl.ReportModel.ReportSettings.AvailableFieldsCollection.Count == 0) { this.availableFields = this.ReadColumnCollection(); -// System.Console.WriteLine("Read from Database"); } else { this.availableFields = this.baseDesignerControl.ReportModel.ReportSettings.AvailableFieldsCollection; -// System.Console.WriteLine("Read from XML File"); } this.baseDesignerControl.ReportModel.ReportSettings.AvailableFieldsCollection = this.availableFields; diff --git a/src/AddIns/Misc/SharpReport/SharpReportAddin/RunSharpReport.cs b/src/AddIns/Misc/SharpReport/SharpReportAddin/Commands/RunSharpReport.cs similarity index 83% rename from src/AddIns/Misc/SharpReport/SharpReportAddin/RunSharpReport.cs rename to src/AddIns/Misc/SharpReport/SharpReportAddin/Commands/RunSharpReport.cs index cfad85e13b..6e6c81211d 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportAddin/RunSharpReport.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportAddin/Commands/RunSharpReport.cs @@ -10,16 +10,13 @@ using System; using System.Windows.Forms; using ICSharpCode.Core; - using ICSharpCode.SharpDevelop.Gui; -//using SharpReport; - -//using SharpReportAddin.Commands; -///Main Command to Run Sharpreport Addin +/// +///Main Command to Run SharpReport Addin /// -namespace SharpReportAddin { +namespace SharpReportAddin.Commands { public class RunSharpReport: AbstractMenuCommand { diff --git a/src/AddIns/Misc/SharpReport/SharpReportAddin/FieldsExplorer/FieldsExplorer.cs b/src/AddIns/Misc/SharpReport/SharpReportAddin/FieldsExplorer/FieldsExplorer.cs index 6718bed06c..80616da1f9 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportAddin/FieldsExplorer/FieldsExplorer.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportAddin/FieldsExplorer/FieldsExplorer.cs @@ -94,6 +94,7 @@ namespace SharpReportAddin { /// Toggle the SortDirection /// public void ToogleSortDirection () { + System.Console.WriteLine("Toggle SortDirection"); if (this.SelectedNode is ColumnsTreeNode) { ColumnsTreeNode cn = (ColumnsTreeNode)this.SelectedNode; if (cn.SortDirection == ListSortDirection.Ascending) { @@ -224,6 +225,7 @@ namespace SharpReportAddin { private void NotifyReportView() { if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent is SharpReportView) { + System.Console.WriteLine("\tNotify View"); WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.IsDirty = true; } } @@ -247,9 +249,8 @@ namespace SharpReportAddin { private void OnViewSaving (object sender, EventArgs e) { if (this.isFilled) { UpdateSorting(); - UpdateGrouping(); + UpdateGrouping(); } - } #endregion diff --git a/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportAddin.addin b/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportAddin.addin index c61daf144b..3d488bd813 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportAddin.addin +++ b/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportAddin.addin @@ -83,6 +83,6 @@ label = "ReportGenerator" shortcut = "Control|Alt|T" - class = "SharpReportAddin.RunSharpReport"/> + class = "SharpReportAddin.Commands.RunSharpReport"/> diff --git a/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportAddin.csproj b/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportAddin.csproj index ff779288b5..93f68d9968 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportAddin.csproj +++ b/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportAddin.csproj @@ -49,7 +49,6 @@ - @@ -57,6 +56,7 @@ Always + diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs index 592c94b2e9..3389c768a9 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs @@ -60,7 +60,6 @@ namespace SharpReportCore { #region Constructores public DataManager(ConnectionObject connectionObject, ReportSettings reportSettings){ CheckAndSetReportSettings(reportSettings); - System.Console.WriteLine("DataManager"); if (connectionObject == null) { throw new ArgumentNullException("DataManager:ConnectionObject"); } @@ -197,7 +196,6 @@ namespace SharpReportCore { } connection.Open(); connection.Close(); - System.Console.WriteLine("DataManager;CheckConnection"); } catch (Exception ) { throw; } @@ -382,7 +380,6 @@ namespace SharpReportCore { public bool DataBind() { - System.Console.WriteLine("Manager:Bind"); this.dataViewStrategy.Bind(); this.dataViewStrategy.GroupChanged += new GroupChangedEventHandler(OnGroupChange); CheckReportColumns(); diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Dialogs/PreviewControl.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Dialogs/PreviewControl.cs index 7d03346a5c..9a4d966ba4 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Dialogs/PreviewControl.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Dialogs/PreviewControl.cs @@ -42,8 +42,9 @@ namespace SharpReportCore{ public void ShowPreviewWithUserControl (AbstractRenderer renderer,double zoomFaktor) { System.Console.WriteLine("PaintArea:WithUserControl"); + System.Drawing.Printing.PrintDocument doc = renderer.ReportDocument; - + /* System.Drawing.Printing.PrintDocument doc = new System.Drawing.Printing.PrintDocument(); @@ -56,7 +57,7 @@ namespace SharpReportCore{ doc.QueryPageSettings += new QueryPageSettingsEventHandler (renderer.ReportDocument.ReportDocumentQueryPage); System.Console.WriteLine("\t All events are set"); - + */ printPreviewControl1.Document = null; printPreviewControl1.Document = doc; diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs index b12c54396c..c1ba059bfb 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs @@ -55,7 +55,7 @@ namespace SharpReportCore { public AbstractRenderer(ReportModel model){ System.Console.WriteLine(""); - System.Console.WriteLine("\t\t ABSTRACT RENDEREER"); + System.Console.WriteLine("\t\t ABSTRACT RENDERER"); this.reportSettings = model.ReportSettings; this.sections = model.SectionCollection; Init(); @@ -334,6 +334,7 @@ namespace SharpReportCore { #region property's public ReportDocument ReportDocument { get { + System.Console.WriteLine("Get the AbstractRenderer:ReportDocument"); return reportDocument; } } @@ -395,17 +396,6 @@ namespace SharpReportCore { detailStart = value; } } - -// protected IWriter Writer { -// get { -// return writer; -// } -// } -//protected AbstractWriter Writer { -// get { -// return writer; -// } -// } #endregion } } diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs index 72354ab9f4..b95d28bd0f 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs @@ -82,7 +82,6 @@ namespace SharpReportCore { void GrapSqlParameters (ReportSettings settings) { - System.Console.WriteLine("GrapSqlParameters"); if (settings.SqlParametersCollection != null && settings.SqlParametersCollection.Count > 0) { if (this.ParametersRequest != null) { SharpReportParametersEventArgs e = new SharpReportParametersEventArgs(); @@ -134,7 +133,7 @@ namespace SharpReportCore { } private DataManager SetupDataContainer (ReportSettings settings) { - System.Console.WriteLine("SetupDataContainer"); + if (settings.ReportType == GlobalEnums.enmReportType.DataReport) { if (settings.CommandText != null) { try { @@ -188,22 +187,17 @@ namespace SharpReportCore { protected SharpReportCore.AbstractRenderer SetupStandartRenderer (ReportModel model) { - System.Console.WriteLine("Engine:SetupStandartRenderer"); AbstractRenderer abstr = null; switch (model.ReportSettings.ReportType) { //FormSheets reports case GlobalEnums.enmReportType.FormSheet: - System.Console.WriteLine("\tFormSheet"); - abstr = new RendererFactory().Create (model,null); + abstr = new RendererFactory().Create (model,null); break; //Databased reports case GlobalEnums.enmReportType.DataReport : - System.Console.WriteLine("\tDatareport"); DataManager dataManager = SetupDataContainer (model.ReportSettings); - if (dataManager != null) { if (dataManager.DataSource != null) { - System.Console.WriteLine("\t\tcreated"); abstr = new RendererFactory().Create (model,dataManager); }