From fa9668570445762ca733a08154b82fa2358c3f38 Mon Sep 17 00:00:00 2001 From: Peter Forstmeier Date: Fri, 29 May 2015 19:19:03 +0200 Subject: [PATCH] Create Interface IReportSettings, designer use ReportSettings from ICSharpCode.Reporting.Addin --- .../CodeQuality/Reporting/BaseReport.cs | 3 +- .../src/DesignableItems/ReportSettings.cs | 1 - .../src/Designer/ReportRootDesigner.cs | 75 +++++++------------ .../ReportDefinitionDeserializer.cs | 27 ++----- .../src/ReportWizard/ReportGenerator.cs | 2 +- .../Src/BaseClasses/ExtensionMethods.cs | 3 +- .../Listhandling/CollectionDataSource.cs | 4 +- .../Exporter/Visitors/ExpressionVisitor.cs | 3 +- .../Src/Expressions/ExpressionRunner.cs | 3 +- .../Expressions/Irony/Ast/AstExtensions.cs | 3 +- .../Src/Interfaces/IReportModel.cs | 2 +- .../Src/Items/ReportModel.cs | 2 +- .../Src/Items/ReportSettings.cs | 5 +- .../Src/PageBuilder/BasePageBuilder.cs | 2 +- .../Src/Wpf/PreviewViewModel.cs | 5 +- 15 files changed, 58 insertions(+), 82 deletions(-) diff --git a/src/AddIns/Analysis/CodeQuality/Reporting/BaseReport.cs b/src/AddIns/Analysis/CodeQuality/Reporting/BaseReport.cs index 00c55cadd0..c2799de1c2 100644 --- a/src/AddIns/Analysis/CodeQuality/Reporting/BaseReport.cs +++ b/src/AddIns/Analysis/CodeQuality/Reporting/BaseReport.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Generic; +using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Items; @@ -41,6 +42,6 @@ namespace ICSharpCode.CodeQuality.Reporting protected List FileNames {get;private set;} - public ReportSettings ReportSettings {get;set;} + public IReportSettings ReportSettings {get;set;} } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs index 7b28c5ad8b..93fbd4606a 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs @@ -13,7 +13,6 @@ using System.Drawing; using System.IO; using ICSharpCode.Reporting.Globals; using ICSharpCode.Reporting.Interfaces; -using ICSharpCode.Reporting.Addin.Designer; namespace ICSharpCode.Reporting.Addin.DesignableItems { diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs index d7da7e7886..8325066e58 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs @@ -38,8 +38,7 @@ namespace ICSharpCode.Reporting.Addin.Designer /// Description of ReportRootDesigner. /// - class ReportRootDesigner: DocumentDesigner - { + class ReportRootDesigner: DocumentDesigner{ ICollection currentSelection; IDesignerHost host; MenuCommandService menuCommandService; @@ -47,12 +46,11 @@ namespace ICSharpCode.Reporting.Addin.Designer ISelectionService selectionService; IComponentChangeService componentChangeService; List sections; - ICSharpCode.Reporting.Items.ReportSettings reportSettings; + ReportSettings reportSettings; RootReportModel rootReportModel; - void ShowMessage(Exception e) - { + void ShowMessage(Exception e){ DisplayError(e); var uiService = (IUIService)host.GetService(typeof(IUIService)); if (uiService != null) { @@ -61,15 +59,13 @@ namespace ICSharpCode.Reporting.Addin.Designer } - void InitializeGUI() - { - reportSettings = host.Container.Components[1] as ICSharpCode.Reporting.Items.ReportSettings; + void InitializeGUI(){ + reportSettings = host.Container.Components[1] as ReportSettings; InitializeRootReportModel(); } - void InitializeRootReportModel () - { + void InitializeRootReportModel (){ rootReportModel = host.Container.Components[0] as RootReportModel; rootReportModel.PageMargin = CalculateMargins(); rootReportModel.Page = new Rectangle(new Point(0,0), reportSettings.PageSize); @@ -78,16 +74,14 @@ namespace ICSharpCode.Reporting.Addin.Designer } - Margins CalculateMargins () - { + Margins CalculateMargins (){ return new Margins(reportSettings.LeftMargin,reportSettings.RightMargin, reportSettings.TopMargin,reportSettings.BottomMargin); } #region overrides - public override void Initialize(IComponent component) - { + public override void Initialize(IComponent component){ base.Initialize(component); sections = new List(); @@ -143,12 +137,12 @@ namespace ICSharpCode.Reporting.Addin.Designer this.selectionService.SelectionChanged += new EventHandler(OnSelectionChanged); } - this.host = (IDesignerHost)GetService(typeof(IDesignerHost)); + host = (IDesignerHost)GetService(typeof(IDesignerHost)); - this.menuCommandService = (MenuCommandService)host.GetService(typeof(MenuCommandService)); + menuCommandService = (MenuCommandService)host.GetService(typeof(MenuCommandService)); if (host != null) { - host.LoadComplete += new EventHandler(OnLoadComplete); + host.LoadComplete += OnLoadComplete; } //Dragdropp only allowed in Section this.Control.AllowDrop = false; @@ -162,9 +156,7 @@ namespace ICSharpCode.Reporting.Addin.Designer } - protected override void PostFilterProperties(IDictionary properties) - { - + protected override void PostFilterProperties(IDictionary properties){ TypeProviderHelper.RemoveProperties(properties); var s = new string[]{"Visible","BackColor", "Text","MaximumSize","MinimumSize", @@ -180,21 +172,19 @@ namespace ICSharpCode.Reporting.Addin.Designer #region Events - void OnSectionSizeChanged (object sender, EventArgs e) - { + void OnSectionSizeChanged (object sender, EventArgs e){ RecalculateSections(); } - void RecalculateSections() - { + void RecalculateSections(){ int locY = 50; + // disable once ConvertIfStatementToNullCoalescingExpression if (reportSettings == null) { - reportSettings = host.Container.Components[1] as ICSharpCode.Reporting.Items.ReportSettings; + reportSettings = host.Container.Components[1] as ReportSettings; } - foreach (BaseSection section in sections) - { + foreach (BaseSection section in sections){ section.Location = new Point(reportSettings.LeftMargin,locY); locY = locY + section.Size.Height + DesignerGlobals.GabBetweenSection; } @@ -203,21 +193,19 @@ namespace ICSharpCode.Reporting.Addin.Designer - void OnLoadComplete(object sender, EventArgs e) - { + void OnLoadComplete(object sender, EventArgs e){ var host = (IDesignerHost)sender; host.LoadComplete -= OnLoadComplete; InitializeGUI(); } - void OnComponentAdded(object sender, ComponentEventArgs ce) - { + void OnComponentAdded(object sender, ComponentEventArgs ce){ var section = ce.Component as BaseSection; if (section != null) { sections.Add(section); - section.SizeChanged += new EventHandler( OnSectionSizeChanged); + section.SizeChanged += OnSectionSizeChanged; foreach (Control ctrl in section.Controls) { AddToHost(ctrl); host.Container.Add(ctrl); @@ -228,8 +216,7 @@ namespace ICSharpCode.Reporting.Addin.Designer } - void AddToHost (Control ctrl) - { + void AddToHost (Control ctrl){ foreach (Control c1 in ctrl.Controls) { AddToHost (c1); } @@ -237,16 +224,15 @@ namespace ICSharpCode.Reporting.Addin.Designer } - private void OnComponentChanged(object sender, ComponentChangedEventArgs ce) - { + void OnComponentChanged(object sender, ComponentChangedEventArgs ce){ LoggingService.InfoFormatted("RootDesigner:OnComponentChanged"); var str = String.Format(CultureInfo.CurrentCulture,"RootDesigner:OnComponentChanged <{0}> from <{1}> to <{2}>",ce.Component.ToString(),ce.OldValue,ce.NewValue); LoggingService.InfoFormatted(str); var section = ce.Component as BaseSection; if (section != null) { - foreach (BaseSection s in sections) - { + foreach (BaseSection s in sections){ + if (s.Name == section.Name) { s.Size = section.Size; } @@ -256,22 +242,19 @@ namespace ICSharpCode.Reporting.Addin.Designer } - void OnComponentChanging(object sender, ComponentChangingEventArgs ce) - { + void OnComponentChanging(object sender, ComponentChangingEventArgs ce){ System.Console.WriteLine("RootDesigner:OnComponentChanging"); // Host.CreateTransaction(); } - void OnSelectionChanged(object sender, EventArgs e) - { + void OnSelectionChanged(object sender, EventArgs e){ currentSelection = ((ISelectionService)sender).GetSelectedComponents(); } #endregion - public IDesignerHost Host { get { if (this.host == null) { @@ -281,8 +264,7 @@ namespace ICSharpCode.Reporting.Addin.Designer } - public IToolboxService ToolboxService - { + public IToolboxService ToolboxService{ get { if (toolboxService == null) @@ -327,8 +309,7 @@ namespace ICSharpCode.Reporting.Addin.Designer #region Dispose - protected override void Dispose(bool disposing) - { + protected override void Dispose(bool disposing){ if (disposing) { var componentService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/ReportDefinitionDeserializer.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/ReportDefinitionDeserializer.cs index 2702a2f922..29f26dd720 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/ReportDefinitionDeserializer.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/ReportDefinitionDeserializer.cs @@ -26,7 +26,6 @@ using ICSharpCode.Core; using ICSharpCode.Reporting.Factories; using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Items; -using ICSharpCode.Reporting.Xml; using ICSharpCode.Reporting.Addin.XML; namespace ICSharpCode.Reporting.Addin.DesignerBinding @@ -34,8 +33,7 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding class ReportDefinitionDeserializer : ReportDefinitionParser { - public static XmlDocument LoadXmlFromStream(Stream stream) - { + public static XmlDocument LoadXmlFromStream(Stream stream){ if (stream == null) throw new ArgumentNullException("stream"); var xmlDocument = new XmlDocument(); @@ -48,14 +46,11 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding } - public ReportModel CreateModelFromXml(XmlElement elem,IDesignerHost host) - { + public ReportModel CreateModelFromXml(XmlElement elem,IDesignerHost host){ var reportSettings = CreateReportSettings(elem); var reportModel = ReportModelFactory.Create(); reportModel.ReportSettings = reportSettings; -// var x = new ICSharpCode.Reporting.Addin.DesignableItems.ReportSettings(); -// host.Container.Add(x); host.Container.Add(reportSettings); //Move to SectionCollection @@ -74,23 +69,17 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding } - ReportSettings CreateReportSettings(XmlElement elem) - { + IReportSettings CreateReportSettings(XmlElement elem){ XmlNodeList nodes = elem.FirstChild.ChildNodes; var reportSettingsNode = (XmlElement)nodes[0]; - var modelLoader = new ModelLoader(); -// var x = (IReportSettings)this.Load(reportSettingsNode,null); - - return modelLoader.Load(reportSettingsNode) as ReportSettings; -// return x; + return Load(reportSettingsNode,null) as IReportSettings; } - protected override Type GetTypeByName(string ns, string name) - { - var a = Assembly.GetExecutingAssembly(); - Type t = a.GetType("ICSharpCode.Reporting.Addin.DesignableItems" + "." + name); - return t; + protected override Type GetTypeByName(string ns, string name){ + var assembly = Assembly.GetExecutingAssembly(); + Type type = assembly.GetType("ICSharpCode.Reporting.Addin.DesignableItems" + "." + name); + return type; } } } 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 7c69893561..0fda95f126 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 @@ -64,7 +64,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard } - ReportSettings GenerateBaseSettings (ReportWizardContext context) { + IReportSettings GenerateBaseSettings (ReportWizardContext context) { var pageOneContext = (PageOneContext)context.PageOneContext; var reportSettings = ReportModel.ReportSettings; reportSettings.DataModel = pageOneContext.DataModel; diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/ExtensionMethods.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/ExtensionMethods.cs index e47c5d5f2e..aa8e1cea4c 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/ExtensionMethods.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/ExtensionMethods.cs @@ -20,6 +20,7 @@ using System; using System.Collections.Generic; using System.Windows; using System.Windows.Media; +using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Items; namespace ICSharpCode.Reporting.BaseClasses @@ -121,7 +122,7 @@ namespace ICSharpCode.Reporting.BaseClasses #region ReportSettings - public static int PrintableWidth (this ReportSettings reportSettings) { + public static int PrintableWidth (this IReportSettings reportSettings) { return reportSettings.PageSize.Width - reportSettings.LeftMargin - reportSettings.RightMargin; } #endregion diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs index 00feb39976..9d92a6f067 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs @@ -43,11 +43,11 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling public class CollectionDataSource:IDataSource { readonly DataCollection baseList; - readonly ReportSettings reportSettings; + readonly IReportSettings reportSettings; readonly PropertyDescriptorCollection listProperties; - public CollectionDataSource(IEnumerable list, ReportSettings reportSettings) + public CollectionDataSource(IEnumerable list, IReportSettings reportSettings) { if (list == null) throw new ArgumentNullException("list"); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/ExpressionVisitor.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/ExpressionVisitor.cs index f1dbfe3d9f..5ccae522d4 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/ExpressionVisitor.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/ExpressionVisitor.cs @@ -22,6 +22,7 @@ using System.Globalization; using ICSharpCode.Reporting.Expressions; using ICSharpCode.Reporting.Expressions.Irony; using ICSharpCode.Reporting.Expressions.Irony.Ast; +using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.PageBuilder.ExportColumns; @@ -35,7 +36,7 @@ namespace ICSharpCode.Reporting.Exporter.Visitors readonly ReportingLanguageGrammer grammar; readonly ReportingExpressionEvaluator evaluator; - public ExpressionVisitor(ReportSettings reportSettings) { + public ExpressionVisitor(IReportSettings reportSettings) { grammar = new ReportingLanguageGrammer(); evaluator = new ReportingExpressionEvaluator(grammar); evaluator.AddReportSettings(reportSettings); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionRunner.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionRunner.cs index 6d1c637aed..01c8ddfac7 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionRunner.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionRunner.cs @@ -19,6 +19,7 @@ using System.Collections.ObjectModel; using ICSharpCode.Reporting.DataManager.Listhandling; using ICSharpCode.Reporting.Exporter.Visitors; +using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.PageBuilder.ExportColumns; @@ -36,7 +37,7 @@ namespace ICSharpCode.Reporting.Expressions readonly Collection pages; readonly CollectionDataSource dataSource; - public ExpressionRunner(Collection pages,ReportSettings reportSettings,CollectionDataSource dataSource){ + public ExpressionRunner(Collection pages,IReportSettings reportSettings,CollectionDataSource dataSource){ this.pages = pages; this.dataSource = dataSource; Visitor = new ExpressionVisitor(reportSettings); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/AstExtensions.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/AstExtensions.cs index b18b5111e6..14c4b60a6b 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/AstExtensions.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/AstExtensions.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using ICSharpCode.Reporting.DataManager.Listhandling; +using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Interfaces.Export; using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.PageBuilder.ExportColumns; @@ -59,7 +60,7 @@ namespace ICSharpCode.Reporting.Expressions.Irony.Ast } - public static void AddReportSettings (this ReportingExpressionEvaluator app,ReportSettings reportSettings) { + public static void AddReportSettings (this ReportingExpressionEvaluator app,IReportSettings reportSettings) { if (reportSettings == null) throw new ArgumentNullException("reportSettings"); app.Globals.Add("ReportSettings",reportSettings); diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/IReportModel.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/IReportModel.cs index 1160579132..ca8294b162 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/IReportModel.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/IReportModel.cs @@ -28,7 +28,7 @@ namespace ICSharpCode.Reporting.Interfaces /// public interface IReportModel { - ReportSettings ReportSettings {get;set;} + IReportSettings ReportSettings {get;set;} Collection SectionCollection {get;} IReportContainer ReportHeader {get;} IReportContainer PageHeader {get;} diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportModel.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportModel.cs index ee995e3aac..a085a15853 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportModel.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportModel.cs @@ -62,7 +62,7 @@ namespace ICSharpCode.Reporting.Items #endregion - public ReportSettings ReportSettings{get;set;} + public IReportSettings ReportSettings{get;set;} public Collection SectionCollection {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 f3ab6b3b34..729580347f 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs @@ -33,6 +33,7 @@ namespace ICSharpCode.Reporting.Items /// /// Description of ReportSettings. /// + /* public class ReportSettingsDesigner:ComponentDesigner { const string settingsName = "ReportSettings"; @@ -46,9 +47,9 @@ namespace ICSharpCode.Reporting.Items component.Site.Name = ReportSettingsDesigner.settingsName; } } + */ - - [Designer(typeof(ReportSettingsDesigner))] +// [Designer(typeof(ReportSettingsDesigner))] public class ReportSettings:Component,IReportSettings { diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/BasePageBuilder.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/BasePageBuilder.cs index 9e52199022..0df582b021 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/BasePageBuilder.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/BasePageBuilder.cs @@ -201,7 +201,7 @@ namespace ICSharpCode.Reporting.PageBuilder #region Visitors - protected void SetupExpressionRunner (ReportSettings reportsettings,CollectionDataSource dataSource){ + protected void SetupExpressionRunner (IReportSettings reportsettings,CollectionDataSource dataSource){ ExpressionRunner = new ExpressionRunner(Pages,reportsettings,dataSource); } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/PreviewViewModel.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/PreviewViewModel.cs index d49f616d8a..5c0bc446f4 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/PreviewViewModel.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/PreviewViewModel.cs @@ -21,6 +21,7 @@ using System.Collections.ObjectModel; using System.ComponentModel; using System.Windows.Documents; +using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.PageBuilder.ExportColumns; using ICSharpCode.Reporting.WpfReportViewer.Visitor; @@ -35,7 +36,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer FixedDocument document ; - public PreviewViewModel(ReportSettings reportSettings, Collection pages) + public PreviewViewModel(IReportSettings reportSettings, Collection pages) { if (pages == null) throw new ArgumentNullException("pages"); @@ -49,7 +50,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer this.Document = wpfExporter.Document; } - static FixedDocument CreateFixedDocument(ReportSettings reportSettings) + static FixedDocument CreateFixedDocument(IReportSettings reportSettings) { var document = new FixedDocument(); document.DocumentPaginator.PageSize = new System.Windows.Size(reportSettings.PageSize.Width,