From 2a0600761d347629da7ae89be62f1370879eb554 Mon Sep 17 00:00:00 2001 From: Peter Forstmeier Date: Fri, 22 Aug 2014 23:03:09 +0200 Subject: [PATCH] Update WizardPages --- .../ReportWizard/Dialog/BaseSettingsPage.xaml | 9 +++--- .../Dialog/BaseSettingsPage.xaml.cs | 4 +-- .../src/ReportWizard/Dialog/ReportWizard.xaml | 14 +++----- .../ReportWizard/Dialog/ReportWizard.xaml.cs | 10 ++---- .../src/ReportWizard/Dialog/WelcomePage.xaml | 18 +++++++---- .../src/ReportWizard/ReportGenerator.cs | 32 +++++++++++++++---- .../Src/Items/ReportSettings.cs | 13 +++----- .../Src/Wpf/Visitor/FixedDocumentCreator.cs | 1 - 8 files changed, 52 insertions(+), 49 deletions(-) diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml index 77b5cb1baf..94bcfec0b7 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml @@ -6,14 +6,13 @@ xmlns:sdr="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting" Title="Base Settings" Description="Basic Settings and Layout" - PageType="Interior" - Background="LightGray" + PageType="Interior" CanFinish="true" CanSelectNextPage="false"> - - - + - + - + - + - + - \ No newline at end of file diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml.cs index 19489041ab..bcb53c0d1f 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml.cs @@ -7,13 +7,8 @@ * To change this template use Tools | Options | Coding | Edit Standard Headers. */ using System; -using System.Drawing; -using System.Drawing.Imaging; -using System.IO; using System.Windows; -using System.Windows.Media.Imaging; using ICSharpCode.Reporting.Globals; -using ICSharpCode.SharpDevelop; using Xceed.Wpf.Toolkit; using ICSharpCode.Reporting.Addin.ReportWizard.Dialog; using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels; @@ -85,10 +80,9 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog } } } - - Console.WriteLine("CurrentPage {0}",current.Name); - } + + void _wizard_PageChanged(object sender, RoutedEventArgs e) { var x = _wizard.CurrentPage; diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/WelcomePage.xaml b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/WelcomePage.xaml index 83b4d4a1e4..d464312050 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/WelcomePage.xaml +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/WelcomePage.xaml @@ -1,4 +1,4 @@ - - - - - + + + + + + + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs index b9787e1cd8..2c01bb8749 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs @@ -34,11 +34,27 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard public void Generate(ReportWizardContext context) { if (context == null) throw new ArgumentNullException("context"); + + var poc = (PageOneContext)context.PageOneContext; + if (IsDataReport(poc)) { + CreateDataReport (context); + } else { + CreateFormSheetReport(context); + } + } + + void CreateFormSheetReport(ReportWizardContext context) + { GenerateBaseSettings(context); - GeneratePushModel(context); CreateReportHeader(context); } - + + void CreateDataReport(ReportWizardContext context) + { + GenerateBaseSettings(context); + CreateReportHeader(context); + GeneratePushModel(context); + } void GenerateBaseSettings (ReportWizardContext context) { var pageOneContext = (PageOneContext)context.PageOneContext; @@ -51,6 +67,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard } + void GeneratePushModel(ReportWizardContext context){ var pushModelContext = (PushModelContext)context.PushModelContext; var xLocation = 5; @@ -83,14 +100,17 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard headerText.Size = GlobalValues.PreferedSize; var printableWith = ReportModel.ReportSettings.PageSize.Width - ReportModel.ReportSettings.LeftMargin - ReportModel.ReportSettings.RightMargin; - var x = (int)(printableWith - headerText.Size.Width) / 2; + var x = (int)(printableWith - headerText.Size.Width) / 2; headerText.Location = new Point(x,4); ReportModel.ReportHeader.Items.Add(headerText); - Console.WriteLine(""); - Console.WriteLine("Createreportheader Size {0}",ReportModel.ReportHeader.Size); + + } + + static bool IsDataReport(PageOneContext poc) + { + return poc.ReportType.Equals(ReportType.DataReport); } - public IReportModel ReportModel {get;private set;} } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs index ac960a1dd2..c10f13ffe3 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs @@ -82,14 +82,15 @@ namespace ICSharpCode.Reporting.Items SortColumnsCollection = new SortColumnCollection(); GroupColumnsCollection = new GroupColumnCollection(); -// this.sqlParameters = new SqlParameterCollection(); ParameterCollection = new ParameterCollection(); +// this.sqlParameters = new SqlParameterCollection(); + // this.NoDataMessage = "No Data for this Report"; } #region BaseSettings - private string reportName; + string reportName; [Category("Base Settings")] [DefaultValueAttribute ("")] @@ -154,7 +155,7 @@ namespace ICSharpCode.Reporting.Items public int RightMargin {get;set;} - private Size pageSize; + Size pageSize; [Category("Page Settings")] public Size PageSize { @@ -177,14 +178,8 @@ namespace ICSharpCode.Reporting.Items #region - // [Category("Data")] - - - - - // [Category("Parameters")] // [EditorAttribute ( typeof(ParameterCollectionEditor), // typeof(System.Drawing.Design.UITypeEditor) )] diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs index 13524e669d..b91b31deee 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs @@ -64,7 +64,6 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor { var culture = CultureInfo.CurrentCulture; var flowDirection = culture.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; - var emSize = ExtensionMethodes.ToPoints((int)exportText.Font.SizeInPoints +1); var formattedText = new FormattedText(exportText.Text,