From 44983298ec9ee5553fe0269bcba70720ac197709 Mon Sep 17 00:00:00 2001 From: Peter Forstmeier Date: Sun, 30 May 2010 16:09:03 +0000 Subject: [PATCH] Modify references, change designer to work with landscape reports git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/reports@5867 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../RootDesigner/ReportItemsContainer.cs | 31 ++- .../RootDesigner/ReportRootDesigner.cs | 80 ++++--- .../DesignerBinding/InternalReportLoader.cs | 42 ++-- .../Project/ReportDesignerView.cs | 47 ++-- .../Generators/AbstractReportGenerator.cs | 5 +- .../Project/ReportWizard/ReportStructure.cs | 162 ++++--------- .../WizardPanels/BaseSettingsPanel.cs | 73 ++++-- .../ICSharpCode.Reports.Core.csproj | 2 +- .../Project/Globals/GlobalValues.cs | 2 +- .../Project/ReportSettings.cs | 218 ++++-------------- 10 files changed, 254 insertions(+), 408 deletions(-) diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportItemsContainer.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportItemsContainer.cs index 25c5db1a31..2b28a8000e 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportItemsContainer.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportItemsContainer.cs @@ -20,8 +20,7 @@ namespace ICSharpCode.Reports.Addin /// public class RootReportModel:RootDesignedComponent { - Margins pageMargin; - Rectangle page; + bool showDebugFrame; [System.ComponentModel.EditorBrowsableAttribute()] @@ -50,34 +49,32 @@ namespace ICSharpCode.Reports.Addin private void PrintMargin( Graphics e) { - string s = String.Format(System.Globalization.CultureInfo.CurrentCulture,"[Bounds : {0}]",this.pageMargin); + string s = String.Format(System.Globalization.CultureInfo.CurrentCulture, + "[Size : {0}] [Landscape : {1}] [Bounds : {2}]", + this.Page,this.Landscape,this.PageMargin); using (Font f = GlobalsDesigner.DesignerFont){ SizeF size = e.MeasureString(s,f); e.DrawString(s,f, new SolidBrush(Color.LightGray), - new Rectangle(this.pageMargin.Left + 100, - this.pageMargin.Top - (int)f.GetHeight() - 3, + new Rectangle(this.PageMargin.Left + 100, + this.PageMargin.Top - (int)f.GetHeight() - 3, (int)size.Width, (int)size.Height)); - Rectangle rect = new Rectangle(this.pageMargin.Left - 2,this.pageMargin.Top - 2, - this.page.Width - this.pageMargin.Left - this.pageMargin.Right + 2, - this.Size.Height - this.pageMargin.Top - this.pageMargin.Bottom + 2); + Rectangle rect = new Rectangle(this.PageMargin.Left - 2,this.PageMargin.Top - 2, + this.Page.Width - this.PageMargin.Left - this.PageMargin.Right + 2, + this.Size.Height - this.PageMargin.Top - this.PageMargin.Bottom + 2); e.DrawRectangle(new Pen(Color.LightGray,1),rect); } } - public Margins PageMargin { - get { return pageMargin; } - set { pageMargin = value; } - } - - public Rectangle Page { - get { return page; } - set { page = value; } - } + public Margins PageMargin {get;set;} + + public Rectangle Page {get;set;} + + public bool Landscape {get;set;} } diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportRootDesigner.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportRootDesigner.cs index a370b84b18..adf7ab49b2 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportRootDesigner.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/Designer/RootDesigner/ReportRootDesigner.cs @@ -14,6 +14,7 @@ using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using System.Drawing.Design; +using System.Drawing.Printing; using System.Windows.Forms; using System.Windows.Forms.Design; @@ -42,6 +43,46 @@ namespace ICSharpCode.Reports.Addin } + private void ShowMessage(Exception e) + { + base.DisplayError(e); + IUIService s = (IUIService)host.GetService(typeof(IUIService)); + if (s != null) { + s.ShowError(e); + } + } + +// private new void DisplayError(Exception ex) +// { +// MessageBox.Show(ex.Message + "\n" + ex.StackTrace, "Fehler im Designer", MessageBoxButtons.OK, MessageBoxIcon.Error); +// } + + + private void InitializeGUI() + { + reportSettings = host.Container.Components[1] as ReportSettings; + InitializeRootReportModel(); + } + + + private void InitializeRootReportModel () + { + this.rootReportModel = host.Container.Components[0] as RootReportModel; + this.rootReportModel.PageMargin = CalculateMargins(); + this.rootReportModel.Page = new Rectangle(new Point(0,0),this.reportSettings.PageSize); + this.rootReportModel.Landscape = this.reportSettings.Landscape; + this.rootReportModel.Invalidate(); + } + + + private Margins CalculateMargins () + { + return new Margins(this.reportSettings.LeftMargin,reportSettings.RightMargin, + reportSettings.TopMargin,reportSettings.BottomMargin); + } + + #region overrides + public override void Initialize(IComponent component) { base.Initialize(component); @@ -125,37 +166,7 @@ namespace ICSharpCode.Reports.Addin "AutoScaleDimensions","DataBindings"}; DesignerHelper.Remove(properties,s); base.PostFilterProperties(properties); - } - - - private void ShowMessage(Exception e) - { - base.DisplayError(e); - IUIService s = (IUIService)host.GetService(typeof(IUIService)); - if (s != null) { - s.ShowError(e); - } - } - -// private new void DisplayError(Exception ex) -// { -// MessageBox.Show(ex.Message + "\n" + ex.StackTrace, "Fehler im Designer", MessageBoxButtons.OK, MessageBoxIcon.Error); -// } - - - private void InitializeGUI() - { - this.rootReportModel = host.Container.Components[0] as RootReportModel; - reportSettings = host.Container.Components[1] as ReportSettings; - this.rootReportModel.PageMargin = new System.Drawing.Printing.Margins(this.reportSettings.LeftMargin,reportSettings.RightMargin, - reportSettings.TopMargin,reportSettings.BottomMargin); - - this.rootReportModel.Page = new Rectangle(0,0, - this.reportSettings.PageSize.Width, - this.reportSettings.PageSize.Height); - this.rootReportModel.Invalidate(); - } - + } public override bool CanParent(ControlDesigner controlDesigner) { @@ -168,13 +179,18 @@ namespace ICSharpCode.Reports.Addin return base.CanBeParentedTo(parentDesigner); } + #endregion + + + #region Events private void OnSectionSizeChanged (object sender, EventArgs e) { this.RecalculateSections(); } + private void RecalculateSections() { int locY = 50; @@ -190,7 +206,7 @@ namespace ICSharpCode.Reports.Addin this.Control.Invalidate(); } - #region Events + private void OnLoadComplete(object sender, EventArgs e) { diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/DesignerBinding/InternalReportLoader.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/DesignerBinding/InternalReportLoader.cs index 728a00826d..01f672d60e 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/DesignerBinding/InternalReportLoader.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/DesignerBinding/InternalReportLoader.cs @@ -7,13 +7,13 @@ * Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern. */ using System; -using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.IO; using System.Windows.Forms; - +using ICSharpCode.Core; using ICSharpCode.Reports.Core; +using ICSharpCode.Reports.Core.Interfaces; using ICSharpCode.SharpDevelop; namespace ICSharpCode.Reports.Addin @@ -26,7 +26,6 @@ namespace ICSharpCode.Reports.Addin private IDesignerLoaderHost host; private Stream stream; private IDesignerGenerator generator; - private ReportModel reportModel; public InternalReportLoader(IDesignerLoaderHost host,IDesignerGenerator generator, Stream stream) { @@ -44,46 +43,43 @@ namespace ICSharpCode.Reports.Addin public void LoadOrCreateReport() { - //string baseClassName = String.Empty; Application.UseWaitCursor = true; Application.DoEvents(); try { IComponent cc = this.host.CreateComponent(typeof(ICSharpCode.Reports.Addin.RootReportModel),"RootReportModel"); ICSharpCode.Reports.Addin.RootReportModel rootControl = cc as ICSharpCode.Reports.Addin.RootReportModel; - - string message; - if (this.generator.ViewContent.PrimaryFile.IsDirty) { - message = String.Format("Create Report + {0} ...",Path.GetFileName(this.generator.ViewContent.PrimaryFile.FileName)); - } else { - message = String.Format("Load Report + {0} ...",Path.GetFileName(this.generator.ViewContent.PrimaryFile.FileName)); - } - StatusBarService.SetMessage(message); + UpdateStatusbar(); this.CreateNamedSurface(); - UnitConverter pageWidth = new UnitConverter(iTextSharp.text.PageSize.A4.Width, XGraphicsUnit.Point); - UnitConverter pageHeight = new UnitConverter(iTextSharp.text.PageSize.A4.Height + (this.reportModel.SectionCollection.Count +1) * GlobalsDesigner.GabBetweenSection - , XGraphicsUnit.Point); - rootControl.Size = new System.Drawing.Size((int)pageWidth.Pixel,(int)pageHeight.Pixel); + rootControl.Size = this.ReportModel.ReportSettings.PageSize; } catch (Exception e) { - System.Console.WriteLine(e.Message); + MessageService.ShowException(e,"LoadOrCreateReport"); } finally { - StatusBarService.SetMessage(String.Empty); Application.UseWaitCursor = false; } } + private void UpdateStatusbar () + { + string message; + if (this.generator.ViewContent.PrimaryFile.IsDirty) { + message = String.Format("Create Report <{0}> ...",Path.GetFileName(this.generator.ViewContent.PrimaryFile.FileName)); + } else { + message = String.Format("Load Report <{0}> ...",Path.GetFileName(this.generator.ViewContent.PrimaryFile.FileName)); + } + StatusBarService.SetMessage(message); + } + private void CreateNamedSurface () { ReportDefinitionDeserializer rl = new ReportDefinitionDeserializer(this.host,stream); - this.reportModel = rl.LoadObjectFromFileDefinition(); + this.ReportModel = rl.LoadObjectFromFileDefinition(); } - public ReportModel ReportModel { - get { return reportModel; } - } - + public ReportModel ReportModel {get; private set;} + } } diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportDesignerView.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportDesignerView.cs index 0e8bada93c..b31d0db320 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportDesignerView.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportDesignerView.cs @@ -36,10 +36,9 @@ namespace ICSharpCode.Reports.Addin private bool hasUnmergedChanges; private bool unloading; - string reportFileContent; - - private Panel panel = new Panel(); + private string reportFileContent; + private Panel panel; private ReportDesignerLoader loader; private IDesignerGenerator generator; @@ -50,7 +49,7 @@ namespace ICSharpCode.Reports.Addin private XmlView xmlView; private ReportPreview preview; private ReportViewerSecondaryView reportViewer; -// private Encoding defaultEncoding = Encoding.UTF8; + #region Constructor @@ -69,8 +68,6 @@ namespace ICSharpCode.Reports.Addin this.generator = generator; this.generator.Attach(this); base.TabPageText = ResourceService.GetString("SharpReport.Design"); - this.panel.Dock = DockStyle.Fill; - this.panel.BackColor = System.Drawing.Color.LightBlue; ReportingSideTabProvider.AddViewContent(this); } @@ -190,30 +187,15 @@ namespace ICSharpCode.Reports.Addin this.unloading = false; if (e.HasSucceeded) { - Control c = null; - c = this.designSurface.View as Control; - c.Parent = this.panel; - c.Dock = DockStyle.Fill; + + CreatePanel(); + SetupDesignSurface(); this.IsFormsDesignerVisible = true; - // to set ReportFileContent initially, we need to manually call MergeFormChanges. - // updates to ReportFileContent will be done using the normal Save support in OpenedFile - // (that just doesn't work initially because the file isn't dirty) generator.MergeFormChanges(null); StartReportExplorer (); - // Display the designer on the view content -// bool savedIsDirty = this.DesignerCodeFile.IsDirty; -// Control designView = (Control)this.designSurface.View; - -// designView.BackColor = Color.White; -// designView.RightToLeft = RightToLeft.No; - // Make sure auto-scaling is based on the correct font. - // This is required on Vista, I don't know why it works correctly in XP -// designView.Font = Control.DefaultFont; - -// this.UserContent = designView; + LoggingService.Debug("FormsDesigner loaded, setting ActiveDesignSurface to " + this.designSurface.ToString()); designSurfaceManager.ActiveDesignSurface = this.designSurface; -// this.DesignerCodeFile.IsDirty = savedIsDirty; this.UpdatePropertyPad(); } else { // This method can not only be called during initialization, @@ -230,7 +212,22 @@ namespace ICSharpCode.Reports.Addin } } + private void CreatePanel () + { + this.panel = new Panel(); + this.panel.Dock = DockStyle.Fill; + this.panel.BackColor = System.Drawing.Color.LightBlue; + } + + private void SetupDesignSurface() + { + Control c = null; + c = this.designSurface.View as Control; + c.Parent = this.panel; + c.Dock = DockStyle.Fill; + } + private void DesingerUnloading(object sender, EventArgs e) { LoggingService.Debug("Forms designer: DesignerLoader unloading..."); diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/Generators/AbstractReportGenerator.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/Generators/AbstractReportGenerator.cs index 0d77b68cfe..863dfc7be9 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/Generators/AbstractReportGenerator.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/Generators/AbstractReportGenerator.cs @@ -57,17 +57,20 @@ namespace ICSharpCode.Reports.Addin.ReportWizard private void AdjustSectionToDefault () { - + ReportSettings settings = reportModel.ReportSettings; foreach (ICSharpCode.Reports.Core.BaseSection s in reportModel.SectionCollection) { s.Size = new Size(settings.PageSize.Width - settings.LeftMargin - settings.RightMargin, GlobalValues.DefaultSectionHeight); + Console.WriteLine("AdjustSectionToDefaul Size : {0}",s.Size); } } protected void WriteToXml () { + Console.WriteLine(" WriteToXml ()"); + ReportDesignerWriter rpd = new ReportDesignerWriter(); StringWriterWithEncoding writer = new StringWriterWithEncoding(System.Text.Encoding.UTF8); XmlTextWriter xml =XmlHelper.CreatePropperWriter(writer); diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/ReportStructure.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/ReportStructure.cs index 43b4f9b018..279b2c8970 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/ReportStructure.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/ReportStructure.cs @@ -23,23 +23,18 @@ namespace ICSharpCode.Reports.Addin.ReportWizard { public class ReportStructure : IDisposable { - //BaseSettingsPanel - private string reportName; - private string fileName; - private string path; - - private GlobalEnums.ReportType reportType; - private GraphicsUnit graphicsUnit; +// private GlobalEnums.ReportType reportType; +// private GraphicsUnit graphicsUnit; //Database - private GlobalEnums.PushPullModel dataModel; +// private GlobalEnums.PushPullModel dataModel; - private string connectionString; - private string sqlString; - - private CommandType commandType; - private SharpQueryProcedure sharpQueryProcedure; +// private string connectionString; +// private string sqlString; +// +// private CommandType commandType; +// private SharpQueryProcedure sharpQueryProcedure; private ReportItemCollection reportItemCollection; private AvailableFieldsCollection availableFieldsCollection; @@ -54,117 +49,59 @@ namespace ICSharpCode.Reports.Addin.ReportWizard { ReportModel model = ReportModel.Create(); - model.ReportSettings.ReportName = this.reportName; - model.ReportSettings.FileName = this.path + this.fileName; + model.ReportSettings.ReportName = this.ReportName; + model.ReportSettings.FileName = this.Path + this.FileName; - model.ReportSettings.GraphicsUnit = this.graphicsUnit; - model.ReportSettings.ReportType = this.reportType; + model.ReportSettings.GraphicsUnit = this.GraphicsUnit; + model.ReportSettings.ReportType = this.ReportType; - model.ReportSettings.ConnectionString = this.connectionString; - model.ReportSettings.CommandText = this.sqlString; - model.ReportSettings.CommandType = this.commandType; - model.ReportSettings.DataModel = this.dataModel; + model.ReportSettings.ConnectionString = this.ConnectionString; + model.ReportSettings.CommandText = this.SqlString; + model.ReportSettings.CommandType = this.CommandType; + model.ReportSettings.DataModel = this.DataModel; + + model.ReportSettings.Landscape = this.Landscape; + + if (Landscape) { + model.ReportSettings.PageSize = new Size(GlobalValues.DefaultPageSize.Height,GlobalValues.DefaultPageSize.Width); + } else { + model.ReportSettings.PageSize = GlobalValues.DefaultPageSize; + } + return model; } #region BaseSettingsPanel property's - public GraphicsUnit GraphicsUnit { - get { - return graphicsUnit; - } - set { - graphicsUnit = value; - } - } - public string ReportName { - get { - return reportName; - } - set { - reportName = value; - } - } - public ICSharpCode.Reports.Core.GlobalEnums.ReportType ReportType { - get { - return reportType; - } - set { - reportType = value; - } - } - public string FileName { - get { - return fileName; - } - set { - fileName = value; - } - } + public GraphicsUnit GraphicsUnit {get;set;} + + public string ReportName {get;set;} - public string Path { - get { - return path; - } - set { - path = value; - } - } + + public ICSharpCode.Reports.Core.GlobalEnums.ReportType ReportType {get;set;} - #endregion + public string FileName {get;set;} - #region DatabasePanel - public string ConnectionString { - get { - return connectionString; - } - set { - connectionString = value; - } - } + public string Path {get;set;} - /* - public string CatalogName { - get { - return catalogName; - } - set { - catalogName = value; - } - } - */ + public bool Landscape {get;set;} - public string SqlString { - get { - return sqlString; - } - set { - sqlString = value; - } - } + #endregion + #region DatabasePanel - public CommandType CommandType - { - get { - return commandType; - } - set { - commandType = value; - } - } + public string ConnectionString {get;set;} - public ICSharpCode.Reports.Core.GlobalEnums.PushPullModel DataModel { - get { - return dataModel; - } - set { - dataModel = value; - } - } + public string SqlString {get;set;} + + public CommandType CommandType {get;set;} + + + public ICSharpCode.Reports.Core.GlobalEnums.PushPullModel DataModel {get;set;} + public ParameterCollection SqlQueryParameters { get { @@ -178,14 +115,7 @@ namespace ICSharpCode.Reports.Addin.ReportWizard /// /// This Property is only usefull for ResultPanel /// - public SharpQueryProcedure SharpQueryProcedure { - get { - return sharpQueryProcedure; - } - set { - sharpQueryProcedure = value; - } - } + public SharpQueryProcedure SharpQueryProcedure {get;set;} #endregion @@ -238,8 +168,8 @@ namespace ICSharpCode.Reports.Addin.ReportWizard } - if (this.sharpQueryProcedure != null) { - this.sharpQueryProcedure = null; + if (this.SharpQueryProcedure != null) { + this.SharpQueryProcedure = null; } } diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/WizardPanels/BaseSettingsPanel.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/WizardPanels/BaseSettingsPanel.cs index 8a655b8286..2960e9c500 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/WizardPanels/BaseSettingsPanel.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportWizard/WizardPanels/BaseSettingsPanel.cs @@ -6,13 +6,15 @@ // using System; +using System.ComponentModel.Design; using System.Drawing; +using System.Runtime.InteropServices; using System.Windows.Forms; - using ICSharpCode.Core; using ICSharpCode.Reports.Core; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Gui; +using Org.BouncyCastle.Crypto.Engines; namespace ICSharpCode.Reports.Addin.ReportWizard{ /// @@ -37,13 +39,19 @@ namespace ICSharpCode.Reports.Addin.ReportWizard{ private System.Windows.Forms.RadioButton radioFormSheet; private System.Windows.Forms.ErrorProvider errorProvider; + + private GroupBox groupPageLayout; + private RadioButton radioStandardLayout; + private RadioButton radioLandscape; + ReportStructure generator; Properties customizer; bool initDone; - public BaseSettingsPanel(){ + public BaseSettingsPanel(){ InitializeComponent(); + AddPageLayout(); errorProvider = new ErrorProvider(); errorProvider.ContainerControl = this; this.txtFileName.KeyUp += new KeyEventHandler(OnKeyUp); @@ -53,6 +61,34 @@ namespace ICSharpCode.Reports.Addin.ReportWizard{ } + private void AddPageLayout () + { + + groupPageLayout = new GroupBox(); + groupPageLayout.Location = new Point (16,110); + groupPageLayout.Size = new System.Drawing.Size(360, 48); + groupPageLayout.Text = "Page Layout"; + + radioStandardLayout = new RadioButton(); + radioStandardLayout.Text = "Standard"; + radioStandardLayout.Location = new Point(24,15); + radioStandardLayout.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + radioStandardLayout.CheckedChanged += SetSuccessor; + + groupPageLayout.Controls.Add(radioStandardLayout); + + radioLandscape = new RadioButton(); + radioLandscape.Text = "Landscape"; + radioLandscape.Location = new Point (150,15); + radioLandscape.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + radioLandscape.CheckedChanged += SetSuccessor; + + groupPageLayout.Controls.Add(radioLandscape); + + this.groupBox1.Controls.Add(groupPageLayout); + } + + private void OnKeyUp (object sender,KeyEventArgs e) { if (this.txtFileName.Text.Length == 0) { this.errorProvider.SetError(this.txtFileName,"aaaaa"); @@ -108,6 +144,8 @@ namespace ICSharpCode.Reports.Addin.ReportWizard{ cboGraphicsUnit.SelectedIndex = cboGraphicsUnit.FindString(GraphicsUnit.Millimeter.ToString()); this.radioPullModell.Checked = true; + this.radioStandardLayout.Checked = true; + initDone = true; } @@ -149,6 +187,8 @@ namespace ICSharpCode.Reports.Addin.ReportWizard{ base.EnableNext = false; base.IsLastPanel = true; } + + generator.Landscape = this.radioLandscape.Checked; } @@ -168,7 +208,14 @@ namespace ICSharpCode.Reports.Addin.ReportWizard{ // generator.DataModel = GlobalEnums.PushPullModel.FormSheet; base.EnableNext = false; base.IsLastPanel = true; + } else if(this.radioStandardLayout.Checked == true) { + + generator.Landscape = false; + + } else if(this.radioLandscape.Checked == true) { + generator.Landscape = true; } + base.EnableFinish = true; } } @@ -233,7 +280,7 @@ namespace ICSharpCode.Reports.Addin.ReportWizard{ // // label4 // - this.label4.Location = new System.Drawing.Point(8, 160); + this.label4.Location = new System.Drawing.Point(16, 168); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(80, 24); this.label4.TabIndex = 15; @@ -287,23 +334,13 @@ namespace ICSharpCode.Reports.Addin.ReportWizard{ // // cboGraphicsUnit // - this.cboGraphicsUnit.Location = new System.Drawing.Point(112, 160); + this.cboGraphicsUnit.Location = new System.Drawing.Point(116, 168); this.cboGraphicsUnit.Name = "cboGraphicsUnit"; - this.cboGraphicsUnit.Size = new System.Drawing.Size(248, 21); + this.cboGraphicsUnit.Size = new System.Drawing.Size(248, 25); this.cboGraphicsUnit.TabIndex = 17; this.cboGraphicsUnit.TextChanged += new System.EventHandler(this.ChangedEvent); this.cboGraphicsUnit.DropDownStyle = ComboBoxStyle.DropDownList; - // - // cboReportType - // - /* - this.cboReportType.Location = new System.Drawing.Point(112, 120); - this.cboReportType.Name = "cboReportType"; - this.cboReportType.Size = new System.Drawing.Size(248, 21); - this.cboReportType.TabIndex = 16; - this.cboReportType.Visible = false; - this.cboReportType.SelectedIndexChanged += new System.EventHandler(this.ChangedEvent); -*/ + // // txtReportName // @@ -319,14 +356,14 @@ namespace ICSharpCode.Reports.Addin.ReportWizard{ this.groupBox1.Controls.Add(this.groupBox2); this.groupBox1.Controls.Add(this.button1); this.groupBox1.Controls.Add(this.cboGraphicsUnit); -// this.groupBox1.Controls.Add(this.cboReportType); + this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.txtPath); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Location = new System.Drawing.Point(8, 160); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(392, 192); + this.groupBox1.Size = new System.Drawing.Size(392, 210); this.groupBox1.TabIndex = 10; this.groupBox1.TabStop = false; // diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/ICSharpCode.Reports.Core.csproj b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/ICSharpCode.Reports.Core.csproj index 709dd5215d..47a8503ab9 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/ICSharpCode.Reports.Core.csproj +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/ICSharpCode.Reports.Core.csproj @@ -63,8 +63,8 @@ - + diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Globals/GlobalValues.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Globals/GlobalValues.cs index 6e8bdf248a..535a4f7a04 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Globals/GlobalValues.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Globals/GlobalValues.cs @@ -26,7 +26,7 @@ using System.Text; namespace ICSharpCode.Reports.Core { public sealed class GlobalValues { -// private static string reportString = "Report"; + private static string reportExtension = ".srd"; private static string xsdExtension = "xsd"; private static string reportFileName = "Report1"; diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportSettings.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportSettings.cs index 8513ecf6b4..9a2298bd68 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportSettings.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ReportSettings.cs @@ -38,7 +38,6 @@ namespace ICSharpCode.Reports.Core{ } - [Designer(typeof(ReportSettingsDesigner))] public class ReportSettings :Component,IDisposable { @@ -47,33 +46,12 @@ namespace ICSharpCode.Reports.Core{ private string reportName; private string fileName; - - - private bool useStandardPrinter; - private bool landSacpe; - private GraphicsUnit graphicsUnit; - - private Padding padding; - private string connectionString; - private string commandText; - private string noDataMessage = "No Data for this Report"; - private System.Data.CommandType commandType = System.Data.CommandType.Text; - - - private Font defaultFont; - - private GlobalEnums.ReportType reportType; - private GlobalEnums.PushPullModel dataModel; - + private ParameterCollection parameterCollection; private AvailableFieldsCollection availableFields; private ColumnCollection groupingsCollection; private SortColumnCollection sortingCollection; - private int bottomMargin; - private int topMargin; - private int leftMargin; - private int rightMargin; - private Size pageSize; + #region Constructor @@ -102,27 +80,28 @@ namespace ICSharpCode.Reports.Core{ this.fileName = BuildFilename(fileName); } BaseValues(); - this.pageSize = pageSize; + this.PageSize = pageSize; } void BaseValues() { - this.useStandardPrinter = true; - this.graphicsUnit = GraphicsUnit.Pixel; - this.padding = new Padding(5); - this.defaultFont = GlobalValues.DefaultFont; - this.reportType = GlobalEnums.ReportType.FormSheet; - this.dataModel = GlobalEnums.PushPullModel.FormSheet; - this.pageSize = GlobalValues.DefaultPageSize; - this.topMargin = GlobalValues.DefaultPageMargin.Left; - this.bottomMargin = GlobalValues.DefaultPageMargin.Bottom; - this.leftMargin = GlobalValues.DefaultPageMargin.Left; - this.rightMargin = GlobalValues.DefaultPageMargin.Right; + this.UseStandardPrinter = true; + this.GraphicsUnit = GraphicsUnit.Pixel; + this.Padding = new Padding(5); + this.DefaultFont = GlobalValues.DefaultFont; + this.ReportType = GlobalEnums.ReportType.FormSheet; + this.DataModel = GlobalEnums.PushPullModel.FormSheet; + this.CommandType = System.Data.CommandType.Text; + this.TopMargin = GlobalValues.DefaultPageMargin.Left; + this.BottomMargin = GlobalValues.DefaultPageMargin.Bottom; + this.LeftMargin = GlobalValues.DefaultPageMargin.Left; + this.RightMargin = GlobalValues.DefaultPageMargin.Right; this.availableFields = new AvailableFieldsCollection(); this.groupingsCollection = new ColumnCollection(); this.sortingCollection = new SortColumnCollection(); this.parameterCollection = new ParameterCollection(); + this.NoDataMessage = "No Data for this Report"; } #endregion @@ -180,64 +159,38 @@ namespace ICSharpCode.Reports.Core{ [Browsable(true), Category("Base Settings")] - public GlobalEnums.ReportType ReportType { - get { - return reportType; - } - set { - if (reportType != value) { - reportType = value; - } - } - } + public GlobalEnums.ReportType ReportType {get;set;} + #endregion #region Page Settings [Category("Page Settings")] - public int BottomMargin { - get { return bottomMargin; } - set { bottomMargin = value; } - } - + public int BottomMargin {get;set;} + [Category("Page Settings")] - public int TopMargin { - get { return topMargin; } - set { topMargin = value; } - } + public int TopMargin {get;set;} [Category("Page Settings")] - public int LeftMargin { - get { return leftMargin; } - set { leftMargin = value; } - } + public int LeftMargin {get;set;} [Category("Page Settings")] - public int RightMargin { - get { return rightMargin; } - set { rightMargin = value; } - } - + public int RightMargin {get;set;} + [Category("Page Settings")] - public Size PageSize { - get { return pageSize; } - set { pageSize = value; } - } - + public Size PageSize {get;set;} + [Category("Page Settings")] - public bool Landscape { - get { return this.landSacpe; } - set { this.landSacpe = value;} - } + public bool Landscape {get;set;} #endregion @@ -246,32 +199,11 @@ namespace ICSharpCode.Reports.Core{ [Category("Designer Settings")] [DefaultValueAttribute (System.Drawing.GraphicsUnit.Millimeter)] - public System.Drawing.GraphicsUnit GraphicsUnit - { - get { - return graphicsUnit; - } - set { - if (graphicsUnit != value) { - graphicsUnit = value; - } - } - } + public System.Drawing.GraphicsUnit GraphicsUnit{get;set;} [Category("Designer Settings")] - public Padding Padding - { - get { - return padding; - } - set { - if (this.padding != value) { - this.padding = value; - } - - } - } + public Padding Padding{get;set;} #endregion @@ -317,76 +249,31 @@ namespace ICSharpCode.Reports.Core{ [DefaultValueAttribute ("")] [EditorAttribute (typeof(DefaultTextEditor), typeof(System.Drawing.Design.UITypeEditor) )] - public string ConnectionString { - get { - if (this.connectionString == null) { - this.connectionString = String.Empty; - } - return connectionString; - } - set { - if (connectionString != value) { - connectionString = value; - } - } - } + public string ConnectionString {get;set;} + [Category("Data")] [DefaultValueAttribute ("")] [EditorAttribute ( typeof(DefaultTextEditor), typeof(System.Drawing.Design.UITypeEditor) )] - public string CommandText { - get { - if (this.commandText == null) { - this.commandText = String.Empty; - } - return commandText; - } - set { - if (commandText != value) { - commandText = value; - } - } - } + public string CommandText {get;set;} + [Category("Data")] - public System.Data.CommandType CommandType { - get { - return commandType; - } - set { - if (commandType != value) { - commandType = value; - } - } - } + public System.Data.CommandType CommandType {get;set;} [Category("Data")] - public GlobalEnums.PushPullModel DataModel { - get { - return dataModel; - } - set { - if (dataModel != value) { - dataModel = value; - } - } - } + public GlobalEnums.PushPullModel DataModel {get;set;} + [Category("Data")] [EditorAttribute ( typeof(DefaultTextEditor), typeof(System.Drawing.Design.UITypeEditor) )] - public string NoDataMessage { - get { - return noDataMessage; - } - set { - noDataMessage = value; - } - } + public string NoDataMessage {get;set;} + #endregion @@ -394,31 +281,14 @@ namespace ICSharpCode.Reports.Core{ #region OutPut Settings [Category("Output Settings")] - public Font DefaultFont { - get { - return defaultFont; - } - set { - if (defaultFont != value) { - defaultFont = value; - } - } - } + public Font DefaultFont {get;set;} + [Category("Output Settings")] [DefaultValueAttribute (true)] - public bool UseStandardPrinter - { - get { - return useStandardPrinter; - } - set { - if (useStandardPrinter != value) { - useStandardPrinter = value; - } - } - } + public bool UseStandardPrinter{get;set;} + #endregion @@ -436,10 +306,10 @@ namespace ICSharpCode.Reports.Core{ if (disposing) { // free managed resources - if (this.defaultFont != null) + if (this.DefaultFont != null) { - this.defaultFont.Dispose(); - this.defaultFont = null; + this.DefaultFont.Dispose(); + this.DefaultFont = null; } } }