diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs index fc3168f701..3766cdd32e 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs @@ -48,7 +48,7 @@ namespace SharpReportCore { string formattedString = base.FireFormatOutput(this.dbValue,this.FormatString,""); RectangleF rect = base.PrepareRectangle (e,formattedString); base.PrintTheStuff (e,formattedString,rect); - base.OnAfterPrint (e.LocationAfterDraw); + base.NotiyfyAfterPrint (e.LocationAfterDraw); } public override string ToString() { diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs index 13fce85449..a449027b6b 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs @@ -167,7 +167,6 @@ namespace SharpReportCore { } set { size = value; -// NotifyPropertyChanged ("Size",true); NotifyPropertyChanged ("Size"); } } @@ -192,14 +191,14 @@ namespace SharpReportCore { } } - public void OnAfterPrint (PointF afterPrint) { + public void NotiyfyAfterPrint (PointF afterPrintLocation) { if (this.AfterPrinting != null) { - AfterPrintEventArgs rea = new AfterPrintEventArgs (afterPrint); + AfterPrintEventArgs rea = new AfterPrintEventArgs (afterPrintLocation); AfterPrinting(this, rea); } } - public void OnBeforePrint () { + public void NotifyBeforePrint () { if (this.BeforePrinting != null) { BeforePrinting (this,EventArgs.Empty); } diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseTextItem.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseTextItem.cs index af263154a3..b8c8512b7d 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseTextItem.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseTextItem.cs @@ -37,7 +37,7 @@ namespace SharpReportCore { base.Render(rpea); RectangleF rect = PrepareRectangle (rpea,this.Text); PrintTheStuff (rpea,this.Text,rect); - base.OnAfterPrint (rpea.LocationAfterDraw); + base.NotiyfyAfterPrint (rpea.LocationAfterDraw); } public override string ToString() { diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BasePageNumber.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BasePageNumber.cs index 59d033a6d0..fb9b8502b5 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BasePageNumber.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BasePageNumber.cs @@ -48,7 +48,7 @@ namespace SharpReportCore { rect, fmt); - base.OnAfterPrint (e.LocationAfterDraw); + base.NotiyfyAfterPrint (e.LocationAfterDraw); } public override string ToString() { diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BaseToday.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BaseToday.cs index be79a1f8c2..547497083b 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BaseToday.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BaseToday.cs @@ -46,7 +46,7 @@ namespace SharpReportCore { fmt); // goon - base.OnAfterPrint (e.LocationAfterDraw); + base.NotiyfyAfterPrint (e.LocationAfterDraw); } public override string ToString() { diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Collections/Collections.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Collections/Collections.cs index 732448e77e..412b228cf1 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/Collections/Collections.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Collections/Collections.cs @@ -124,7 +124,8 @@ namespace SharpReportCore{ public BaseReportObject Find (string columnName) { for (int i = 0;i < this.Count ; i ++) { BaseReportObject col = this[i]; - if (String.Compare(col.Name,columnName)== 0){ + if (String.Compare(col.Name.ToLower(CultureInfo.CurrentCulture), + columnName.ToLower(CultureInfo.CurrentCulture))== 0){ return col; } } @@ -149,7 +150,8 @@ namespace SharpReportCore{ public AbstractColumn Find (string columnName) { for (int i = 0;i < this.Count ; i ++) { AbstractColumn col = (AbstractColumn)this[i]; - if (String.Compare(col.ColumnName,columnName)== 0){ + if (String.Compare(col.ColumnName.ToLower(CultureInfo.CurrentCulture), + columnName.ToLower(CultureInfo.CurrentCulture))== 0){ return col; } } diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs index c6d143be07..4eecaf1491 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs @@ -14,16 +14,15 @@ using System.Collections; using System.ComponentModel; using System.Globalization; -using SharpReportCore; -using System.Windows.Forms; +//using SharpReportCore; - /// - /// This Class is used as a wrapper around Databinding - /// - /// - /// created by - Forstmeier Peter - /// created on - 16.10.2005 14:49:43 - /// +/// +/// This Class is used as a wrapper around Databinding +/// +/// +/// created by - Forstmeier Peter +/// created on - 16.10.2005 14:49:43 +/// namespace SharpReportCore { public class DataManager : IDataContainer,IEnumerator,IDisposable { @@ -47,7 +46,7 @@ namespace SharpReportCore { IDataViewStrategy dataViewStrategy; -// private ListChangedEventArgs resetList = new ListChangedEventArgs(ListChangedType.Reset,-1,-1); + private ListChangedEventArgs resetList = new ListChangedEventArgs(ListChangedType.Reset,-1,-1); public event ListChangedEventHandler ListChanged; public event EventHandler GroupChanged; @@ -71,7 +70,7 @@ namespace SharpReportCore { this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource, reportSettings); - this.dataViewStrategy.ListChanged += new ListChangedEventHandler (OnListChanged); + this.dataViewStrategy.ListChanged += new ListChangedEventHandler (NotifyListChanged); } catch (Exception) { throw; } @@ -80,12 +79,11 @@ namespace SharpReportCore { public DataManager(DataTable dataSource, ReportSettings reportSettings){ try { - System.Console.WriteLine("DataManager (table,model"); CheckAndSetReportSettings(reportSettings); CheckAndSetSource(dataSource); this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource, reportSettings); - this.dataViewStrategy.ListChanged += new ListChangedEventHandler (OnListChanged); + this.dataViewStrategy.ListChanged += new ListChangedEventHandler (NotifyListChanged); } catch (Exception) { throw ; } @@ -105,7 +103,7 @@ namespace SharpReportCore { CheckAndSetSource(dataSource); this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource, reportSettings); - this.dataViewStrategy.ListChanged += new ListChangedEventHandler (OnListChanged); + this.dataViewStrategy.ListChanged += new ListChangedEventHandler (NotifyListChanged); } catch (Exception ) { throw ; } @@ -118,7 +116,7 @@ namespace SharpReportCore { this.dataViewStrategy = new CollectionStrategy ((IList)this.dataSource, this.dataMember, reportSettings); - this.dataViewStrategy.ListChanged += new ListChangedEventHandler (OnListChanged); + this.dataViewStrategy.ListChanged += new ListChangedEventHandler (NotifyListChanged); } catch (Exception) { throw; } @@ -132,17 +130,14 @@ namespace SharpReportCore { if (settings == null) { throw new ArgumentNullException("DataManager:ReportSettings"); } -System.Console.WriteLine("CheckAndSetReportSettings"); try { - System.Console.WriteLine("\t {0}",settings.DataModel.ToString()); if (settings.DataModel != GlobalEnums.enmPushPullModel.PushData) { SqlQueryCkecker check = new SqlQueryCkecker(); check.Check(settings.CommandText); } - } catch (Exception e) { - MessageBox.Show (e.Message); - throw ; + } catch (Exception) { + throw; } this.reportSettings = settings; @@ -150,11 +145,10 @@ System.Console.WriteLine("CheckAndSetReportSettings"); void CheckAndSetSource(object source) { - System.Console.WriteLine("CheckAndSetSource"); if (source == null) { throw new MissingDataSourceException(); - } + if (source is IList ||source is IListSource || source is IBindingList) { //DataTable this.dataSource = source; @@ -202,9 +196,7 @@ System.Console.WriteLine("CheckAndSetReportSettings"); } void CheckConnection (ConnectionObject connectionObject) { - System.Console.WriteLine("CheckOnnection"); try { - connection = connectionObject.Connection; if (connection.State == ConnectionState.Open) { connection.Close(); @@ -217,7 +209,6 @@ System.Console.WriteLine("CheckAndSetReportSettings"); } private DataSet FillDataSet() { - System.Console.WriteLine("FillDataSet"); try { if (this.connection.State == ConnectionState.Closed) { this.connection.Open(); @@ -234,7 +225,7 @@ System.Console.WriteLine("CheckAndSetReportSettings"); DataSet ds = new DataSet(); ds.Locale = CultureInfo.CurrentCulture; adapter.Fill (ds); - System.Console.WriteLine("\t {0} in Table",ds.Tables[0].Rows.Count); +// System.Console.WriteLine("\t {0} in Table",ds.Tables[0].Rows.Count); return ds; } catch (Exception) { throw; @@ -276,7 +267,7 @@ System.Console.WriteLine("CheckAndSetReportSettings"); if (this.dataViewStrategy.AvailableFields.Count > 0) { foreach (SortColumn col in this.reportSettings.SortColumnCollection) { string colName = col.ColumnName; - AbstractColumn c = this.dataViewStrategy.AvailableFields.Find (colName); + AbstractColumn c = this.dataViewStrategy.AvailableFields.Find (colName); if (c == null) { string str = String.Format (CultureInfo.CurrentCulture, "<{0}> is not a member of <{1}>",colName,this.reportSettings.ReportName); @@ -289,13 +280,13 @@ System.Console.WriteLine("CheckAndSetReportSettings"); #region Event Handling - private void OnListChanged (object sender, ListChangedEventArgs e) { + private void NotifyListChanged (object sender, ListChangedEventArgs e) { if (this.ListChanged != null) { this.ListChanged (this,e); } } - private void OnGroupChange (object sender,GroupChangedEventArgs e) { + private void NotifyGroupChange (object sender,GroupChangedEventArgs e) { if (this.GroupChanged != null) { this.GroupChanged (this,e); @@ -398,8 +389,9 @@ System.Console.WriteLine("CheckAndSetReportSettings"); public bool DataBind() { this.dataViewStrategy.Bind(); - this.dataViewStrategy.GroupChanged += new EventHandler (OnGroupChange); + this.dataViewStrategy.GroupChanged += new EventHandler (NotifyGroupChange); CheckReportColumns(); +// this.NotifyListChanged (this,this.resetList); return true; } diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListHandling/SharpArrayList.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListHandling/SharpArrayList.cs index 14e33a9e38..e609dfd0f5 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListHandling/SharpArrayList.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListHandling/SharpArrayList.cs @@ -4,10 +4,10 @@ using System.Reflection; using System.Collections; using System.ComponentModel; + +using System.Collections.Generic; namespace SharpReportCore { - /// - /// This Class is the BaseClass for all Lists witch handles sorting,grouping etc. /// public class SharpArrayList : ArrayList, IBindingList ,ITypedList,IExtendedList diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs index 88b44de30f..728c6d450b 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs @@ -12,7 +12,7 @@ using System.Text; using System.Collections; using System.Data; using System.ComponentModel; -using System.Windows.Forms; + using SharpReportCore; namespace SharpReportCore { @@ -40,7 +40,8 @@ namespace SharpReportCore { // System.Console.WriteLine("called from view"); // MessageBox.Show ("On List Change"); // } - + + /* private string a_BuildSort(ColumnCollection sortCollection){ System.Console.WriteLine("BuildSort"); StringBuilder sb = new StringBuilder(); @@ -61,6 +62,7 @@ namespace SharpReportCore { System.Console.WriteLine("\tsort by {0}",sb.ToString()); return sb.ToString(); } + */ #region Building the Index list // if we have no sorting, we build the indexlist as well, so we don't need to diff --git a/src/AddIns/Misc/SharpReport/SharpReportWizard/GeneratorCommands.cs b/src/AddIns/Misc/SharpReport/SharpReportWizard/GeneratorCommands.cs index 231fcf35ae..257de50def 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportWizard/GeneratorCommands.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportWizard/GeneratorCommands.cs @@ -39,7 +39,7 @@ namespace ReportGenerator{ public class CreateReport : AbstractMenuCommand { const string WizardPath = "/ReportGenerator/ReportGeneratorWizard"; - private ReportModel reportModel = null; + private ReportModel reportModel; private Properties customizer = new Properties(); @@ -77,7 +77,7 @@ namespace ReportGenerator{ void DoCreate (ReportModel model) { GlobalEnums.enmPushPullModel dataModel; - dataModel = model.ReportSettings.DataModel; + dataModel = model.DataModel; switch (dataModel) { case GlobalEnums.enmPushPullModel.PullData: GeneratePullReport (model); @@ -101,7 +101,6 @@ namespace ReportGenerator{ void GeneratePullReport (ReportModel model) { try { - ReportGenerator reportGenerator = (ReportGenerator)customizer.Get("Generator"); GeneratePullDataReport generator = new GeneratePullDataReport(customizer,model); if (generator != null) { generator.GenerateReport(); @@ -119,17 +118,15 @@ namespace ReportGenerator{ /// /// ReportModel void GeneratePushReport (ReportModel model) { - try { - ReportGenerator reportGenerator = (ReportGenerator)customizer.Get("Generator"); GeneratePushDataReport generator = new GeneratePushDataReport(customizer,model); if (generator != null) { generator.GenerateReport(); } else { throw new NullReferenceException ("GeneratePullDataReport"); } - } catch (Exception) { - throw; + } catch (Exception e) { + throw e; } } @@ -142,7 +139,6 @@ namespace ReportGenerator{ try { model.ReportSettings.ReportType = GlobalEnums.enmReportType.FormSheet; - SharpReportManager manager = new SharpReportManager(); } catch (Exception e) { throw e; } diff --git a/src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/AbstractReportGenerator.cs b/src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/AbstractReportGenerator.cs index 24a411845f..1c14501412 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/AbstractReportGenerator.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/AbstractReportGenerator.cs @@ -45,7 +45,7 @@ namespace ReportGenerator { this.customizer = customizer; this.reportModel = reportModel; if (reportModel == null) { - throw new ArgumentNullException("GeneratePullDataReport: -/// TODO - Add class summary +/// This class build a TableLayout /// namespace ReportGenerator { public class TableLayout : AbstractLayout { - int colWidth = 0; + int colWidth; Font defaultFont; public TableLayout(ReportModel reportModel):base(reportModel) { diff --git a/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/BaseSettingsPanel.cs b/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/BaseSettingsPanel.cs index 8d524e8843..649f448aa2 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/BaseSettingsPanel.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/BaseSettingsPanel.cs @@ -8,10 +8,11 @@ */ using System; -using System.ComponentModel; using System.Drawing; +using System.Globalization; +//using System.ComponentModel; + using System.Windows.Forms; -//using System.Windows.Forms.Design; using ICSharpCode.Core; using ICSharpCode.SharpDevelop; @@ -42,10 +43,10 @@ namespace ReportGenerator{ private System.Windows.Forms.Label label4; private System.Windows.Forms.RadioButton radioFormSheet; - ReportGenerator generator = null; - Properties customizer = null; + ReportGenerator generator; + Properties customizer; - bool initDone = false; + bool initDone; public BaseSettingsPanel(){ InitializeComponent(); @@ -121,10 +122,10 @@ namespace ReportGenerator{ generator.ReportName = txtReportName.Text; generator.FileName = txtFileName.Text; generator.Path = this.txtPath.Text; - generator.GraphicsUnit = (GraphicsUnit)Enum.Parse(typeof(GraphicsUnit),this.cboGraphicsUnit.Text); SetSuccessor (this,new EventArgs()); } + } @@ -159,11 +160,19 @@ namespace ReportGenerator{ try { ICSharpCode.SharpDevelop.Gui.FolderDialog ff = new ICSharpCode.SharpDevelop.Gui.FolderDialog(); ff.DisplayDialog(""); - if (ff.Path.Length > 0) { -// this.txtPath.Text = FileUtility.GetDirectoryNameWithSeparator(ff.Path.Trim()); - MessageBox.Show("BaseSettingPanel path : " +ff.Path); - this.txtPath.Text = ff.Path; + if (!String.IsNullOrEmpty(ff.Path)) { + if (!ff.Path.EndsWith(@"\")){ + + this.txtPath.Text = ff.Path + @"\"; + System.Console.WriteLine("added slash"); + } else { + + this.txtPath.Text = ff.Path; + System.Console.WriteLine("no slash added"); + } + generator.Path = this.txtPath.Text; } + } catch (Exception ) { throw ; } diff --git a/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PullModelPanel.cs b/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PullModelPanel.cs index 75f0a3ab77..a33ac2eb9b 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PullModelPanel.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PullModelPanel.cs @@ -56,15 +56,15 @@ namespace ReportGenerator nodeError } - private bool firstDrag = true; - private string connectionString = String.Empty; - private string catalogName = String.Empty; + private bool firstDrag; + private string connectionString; + private CommandType commandType; - private ReportGenerator generator = null; - private Properties customizer = null; + private ReportGenerator generator; + private Properties customizer; - private ISharpQueryNode currentNode = null; + private ISharpQueryNode currentNode; public PullModelPanel() @@ -74,6 +74,7 @@ namespace ReportGenerator base.EnableFinish = false; base.EnableNext = false; base.EnableCancel = true; + this.firstDrag = true; commandType = CommandType.Text; this.txtSqlString.Enabled = false; Localise(); @@ -134,8 +135,6 @@ namespace ReportGenerator } void TxtSqlStringDragDrop(object sender, System.Windows.Forms.DragEventArgs e){ - string strDrag = (string)e.Data.GetData(typeof(string)); - if (firstDrag == true) { this.txtSqlString.Text = ""; firstDrag = false; @@ -204,7 +203,6 @@ namespace ReportGenerator if (node.Connection.ConnectionString.Length > 0) { this.connectionString = node.Connection.ConnectionString; - this.catalogName = node.Connection.CatalogName; this.txtSqlString.Enabled = true; if (this.firstDrag) { diff --git a/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PushModelPanel.cs b/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PushModelPanel.cs index cd94c7e5c9..0b87cf66aa 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PushModelPanel.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PushModelPanel.cs @@ -35,10 +35,10 @@ namespace ReportGenerator private System.Windows.Forms.CheckedListBox checkedListBox; private System.Windows.Forms.TextBox txtPath; - private ReportGenerator generator = null; - private Properties customizer = null; + private ReportGenerator generator; + private Properties customizer; - private ReportItemCollection colDetail = null; + private ReportItemCollection colDetail; public PushModelPanel(){ InitializeComponent(); diff --git a/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/ResultPanel.cs b/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/ResultPanel.cs index 1a7f9c1eda..19eeafbf7f 100644 --- a/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/ResultPanel.cs +++ b/src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/ResultPanel.cs @@ -41,8 +41,8 @@ namespace ReportGenerator{ private System.Windows.Forms.TextBox txtSqlString; private System.Windows.Forms.DataGrid grdQuery; - private ReportGenerator generator = null; - private Properties customizer = null; + private ReportGenerator generator; + private Properties customizer; private SharpQuerySchemaClassCollection parametersClass; @@ -110,8 +110,8 @@ namespace ReportGenerator{ try { // Stored Proc without Parameters resultDataSet = (DataSet) proc.Execute(0,proc.GetSchemaParameters()); - } catch (Exception) { - throw; + } catch (Exception e) { + throw e; } }