Browse Source

Create Interface IReportSettings, designer use ReportSettings from ICSharpCode.Reporting.Addin

pull/685/head
Peter Forstmeier 11 years ago
parent
commit
fa96685704
  1. 3
      src/AddIns/Analysis/CodeQuality/Reporting/BaseReport.cs
  2. 1
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs
  3. 75
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs
  4. 27
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/ReportDefinitionDeserializer.cs
  5. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs
  6. 3
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/ExtensionMethods.cs
  7. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs
  8. 3
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/ExpressionVisitor.cs
  9. 3
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionRunner.cs
  10. 3
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/AstExtensions.cs
  11. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/IReportModel.cs
  12. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportModel.cs
  13. 5
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs
  14. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/BasePageBuilder.cs
  15. 5
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/PreviewViewModel.cs

3
src/AddIns/Analysis/CodeQuality/Reporting/BaseReport.cs

@ -18,6 +18,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.Items;
@ -41,6 +42,6 @@ namespace ICSharpCode.CodeQuality.Reporting
protected List<string> FileNames {get;private set;} protected List<string> FileNames {get;private set;}
public ReportSettings ReportSettings {get;set;} public IReportSettings ReportSettings {get;set;}
} }
} }

1
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs

@ -13,7 +13,6 @@ using System.Drawing;
using System.IO; using System.IO;
using ICSharpCode.Reporting.Globals; using ICSharpCode.Reporting.Globals;
using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Addin.Designer;
namespace ICSharpCode.Reporting.Addin.DesignableItems namespace ICSharpCode.Reporting.Addin.DesignableItems
{ {

75
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs

@ -38,8 +38,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
/// Description of ReportRootDesigner. /// Description of ReportRootDesigner.
/// </summary> /// </summary>
class ReportRootDesigner: DocumentDesigner class ReportRootDesigner: DocumentDesigner{
{
ICollection currentSelection; ICollection currentSelection;
IDesignerHost host; IDesignerHost host;
MenuCommandService menuCommandService; MenuCommandService menuCommandService;
@ -47,12 +46,11 @@ namespace ICSharpCode.Reporting.Addin.Designer
ISelectionService selectionService; ISelectionService selectionService;
IComponentChangeService componentChangeService; IComponentChangeService componentChangeService;
List<BaseSection> sections; List<BaseSection> sections;
ICSharpCode.Reporting.Items.ReportSettings reportSettings; ReportSettings reportSettings;
RootReportModel rootReportModel; RootReportModel rootReportModel;
void ShowMessage(Exception e) void ShowMessage(Exception e){
{
DisplayError(e); DisplayError(e);
var uiService = (IUIService)host.GetService(typeof(IUIService)); var uiService = (IUIService)host.GetService(typeof(IUIService));
if (uiService != null) { if (uiService != null) {
@ -61,15 +59,13 @@ namespace ICSharpCode.Reporting.Addin.Designer
} }
void InitializeGUI() void InitializeGUI(){
{ reportSettings = host.Container.Components[1] as ReportSettings;
reportSettings = host.Container.Components[1] as ICSharpCode.Reporting.Items.ReportSettings;
InitializeRootReportModel(); InitializeRootReportModel();
} }
void InitializeRootReportModel () void InitializeRootReportModel (){
{
rootReportModel = host.Container.Components[0] as RootReportModel; rootReportModel = host.Container.Components[0] as RootReportModel;
rootReportModel.PageMargin = CalculateMargins(); rootReportModel.PageMargin = CalculateMargins();
rootReportModel.Page = new Rectangle(new Point(0,0), reportSettings.PageSize); 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, return new Margins(reportSettings.LeftMargin,reportSettings.RightMargin,
reportSettings.TopMargin,reportSettings.BottomMargin); reportSettings.TopMargin,reportSettings.BottomMargin);
} }
#region overrides #region overrides
public override void Initialize(IComponent component) public override void Initialize(IComponent component){
{
base.Initialize(component); base.Initialize(component);
sections = new List<BaseSection>(); sections = new List<BaseSection>();
@ -143,12 +137,12 @@ namespace ICSharpCode.Reporting.Addin.Designer
this.selectionService.SelectionChanged += new EventHandler(OnSelectionChanged); 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) if (host != null)
{ {
host.LoadComplete += new EventHandler(OnLoadComplete); host.LoadComplete += OnLoadComplete;
} }
//Dragdropp only allowed in Section //Dragdropp only allowed in Section
this.Control.AllowDrop = false; 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); TypeProviderHelper.RemoveProperties(properties);
var s = new string[]{"Visible","BackColor", var s = new string[]{"Visible","BackColor",
"Text","MaximumSize","MinimumSize", "Text","MaximumSize","MinimumSize",
@ -180,21 +172,19 @@ namespace ICSharpCode.Reporting.Addin.Designer
#region Events #region Events
void OnSectionSizeChanged (object sender, EventArgs e) void OnSectionSizeChanged (object sender, EventArgs e){
{
RecalculateSections(); RecalculateSections();
} }
void RecalculateSections() void RecalculateSections(){
{
int locY = 50; int locY = 50;
// disable once ConvertIfStatementToNullCoalescingExpression
if (reportSettings == null) { 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); section.Location = new Point(reportSettings.LeftMargin,locY);
locY = locY + section.Size.Height + DesignerGlobals.GabBetweenSection; 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; var host = (IDesignerHost)sender;
host.LoadComplete -= OnLoadComplete; host.LoadComplete -= OnLoadComplete;
InitializeGUI(); InitializeGUI();
} }
void OnComponentAdded(object sender, ComponentEventArgs ce) void OnComponentAdded(object sender, ComponentEventArgs ce){
{
var section = ce.Component as BaseSection; var section = ce.Component as BaseSection;
if (section != null) { if (section != null) {
sections.Add(section); sections.Add(section);
section.SizeChanged += new EventHandler( OnSectionSizeChanged); section.SizeChanged += OnSectionSizeChanged;
foreach (Control ctrl in section.Controls) { foreach (Control ctrl in section.Controls) {
AddToHost(ctrl); AddToHost(ctrl);
host.Container.Add(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) { foreach (Control c1 in ctrl.Controls) {
AddToHost (c1); 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"); LoggingService.InfoFormatted("RootDesigner:OnComponentChanged");
var str = String.Format(CultureInfo.CurrentCulture,"RootDesigner:OnComponentChanged <{0}> from <{1}> to <{2}>",ce.Component.ToString(),ce.OldValue,ce.NewValue); var str = String.Format(CultureInfo.CurrentCulture,"RootDesigner:OnComponentChanged <{0}> from <{1}> to <{2}>",ce.Component.ToString(),ce.OldValue,ce.NewValue);
LoggingService.InfoFormatted(str); LoggingService.InfoFormatted(str);
var section = ce.Component as BaseSection; var section = ce.Component as BaseSection;
if (section != null) { if (section != null) {
foreach (BaseSection s in sections) foreach (BaseSection s in sections){
{
if (s.Name == section.Name) { if (s.Name == section.Name) {
s.Size = section.Size; 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"); System.Console.WriteLine("RootDesigner:OnComponentChanging");
// Host.CreateTransaction(); // Host.CreateTransaction();
} }
void OnSelectionChanged(object sender, EventArgs e) void OnSelectionChanged(object sender, EventArgs e){
{
currentSelection = ((ISelectionService)sender).GetSelectedComponents(); currentSelection = ((ISelectionService)sender).GetSelectedComponents();
} }
#endregion #endregion
public IDesignerHost Host { public IDesignerHost Host {
get { get {
if (this.host == null) { if (this.host == null) {
@ -281,8 +264,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
} }
public IToolboxService ToolboxService public IToolboxService ToolboxService{
{
get get
{ {
if (toolboxService == null) if (toolboxService == null)
@ -327,8 +309,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
#region Dispose #region Dispose
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing){
{
if (disposing) if (disposing)
{ {
var componentService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); var componentService = (IComponentChangeService)GetService(typeof(IComponentChangeService));

27
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.Factories;
using ICSharpCode.Reporting.Interfaces; using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.Items;
using ICSharpCode.Reporting.Xml;
using ICSharpCode.Reporting.Addin.XML; using ICSharpCode.Reporting.Addin.XML;
namespace ICSharpCode.Reporting.Addin.DesignerBinding namespace ICSharpCode.Reporting.Addin.DesignerBinding
@ -34,8 +33,7 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding
class ReportDefinitionDeserializer : ReportDefinitionParser class ReportDefinitionDeserializer : ReportDefinitionParser
{ {
public static XmlDocument LoadXmlFromStream(Stream stream) public static XmlDocument LoadXmlFromStream(Stream stream){
{
if (stream == null) if (stream == null)
throw new ArgumentNullException("stream"); throw new ArgumentNullException("stream");
var xmlDocument = new XmlDocument(); 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 reportSettings = CreateReportSettings(elem);
var reportModel = ReportModelFactory.Create(); var reportModel = ReportModelFactory.Create();
reportModel.ReportSettings = reportSettings; reportModel.ReportSettings = reportSettings;
// var x = new ICSharpCode.Reporting.Addin.DesignableItems.ReportSettings();
// host.Container.Add(x);
host.Container.Add(reportSettings); host.Container.Add(reportSettings);
//Move to SectionCollection //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; XmlNodeList nodes = elem.FirstChild.ChildNodes;
var reportSettingsNode = (XmlElement)nodes[0]; var reportSettingsNode = (XmlElement)nodes[0];
var modelLoader = new ModelLoader(); return Load(reportSettingsNode,null) as IReportSettings;
// var x = (IReportSettings)this.Load(reportSettingsNode,null);
return modelLoader.Load(reportSettingsNode) as ReportSettings;
// return x;
} }
protected override Type GetTypeByName(string ns, string name) protected override Type GetTypeByName(string ns, string name){
{ var assembly = Assembly.GetExecutingAssembly();
var a = Assembly.GetExecutingAssembly(); Type type = assembly.GetType("ICSharpCode.Reporting.Addin.DesignableItems" + "." + name);
Type t = a.GetType("ICSharpCode.Reporting.Addin.DesignableItems" + "." + name); return type;
return t;
} }
} }
} }

2
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 pageOneContext = (PageOneContext)context.PageOneContext;
var reportSettings = ReportModel.ReportSettings; var reportSettings = ReportModel.ReportSettings;
reportSettings.DataModel = pageOneContext.DataModel; reportSettings.DataModel = pageOneContext.DataModel;

3
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/ExtensionMethods.cs

@ -20,6 +20,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.Items;
namespace ICSharpCode.Reporting.BaseClasses namespace ICSharpCode.Reporting.BaseClasses
@ -121,7 +122,7 @@ namespace ICSharpCode.Reporting.BaseClasses
#region ReportSettings #region ReportSettings
public static int PrintableWidth (this ReportSettings reportSettings) { public static int PrintableWidth (this IReportSettings reportSettings) {
return reportSettings.PageSize.Width - reportSettings.LeftMargin - reportSettings.RightMargin; return reportSettings.PageSize.Width - reportSettings.LeftMargin - reportSettings.RightMargin;
} }
#endregion #endregion

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs

@ -43,11 +43,11 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
public class CollectionDataSource:IDataSource public class CollectionDataSource:IDataSource
{ {
readonly DataCollection<object> baseList; readonly DataCollection<object> baseList;
readonly ReportSettings reportSettings; readonly IReportSettings reportSettings;
readonly PropertyDescriptorCollection listProperties; readonly PropertyDescriptorCollection listProperties;
public CollectionDataSource(IEnumerable list, ReportSettings reportSettings) public CollectionDataSource(IEnumerable list, IReportSettings reportSettings)
{ {
if (list == null) if (list == null)
throw new ArgumentNullException("list"); throw new ArgumentNullException("list");

3
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;
using ICSharpCode.Reporting.Expressions.Irony; using ICSharpCode.Reporting.Expressions.Irony;
using ICSharpCode.Reporting.Expressions.Irony.Ast; using ICSharpCode.Reporting.Expressions.Irony.Ast;
using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.Items;
using ICSharpCode.Reporting.PageBuilder.ExportColumns; using ICSharpCode.Reporting.PageBuilder.ExportColumns;
@ -35,7 +36,7 @@ namespace ICSharpCode.Reporting.Exporter.Visitors
readonly ReportingLanguageGrammer grammar; readonly ReportingLanguageGrammer grammar;
readonly ReportingExpressionEvaluator evaluator; readonly ReportingExpressionEvaluator evaluator;
public ExpressionVisitor(ReportSettings reportSettings) { public ExpressionVisitor(IReportSettings reportSettings) {
grammar = new ReportingLanguageGrammer(); grammar = new ReportingLanguageGrammer();
evaluator = new ReportingExpressionEvaluator(grammar); evaluator = new ReportingExpressionEvaluator(grammar);
evaluator.AddReportSettings(reportSettings); evaluator.AddReportSettings(reportSettings);

3
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionRunner.cs

@ -19,6 +19,7 @@
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using ICSharpCode.Reporting.DataManager.Listhandling; using ICSharpCode.Reporting.DataManager.Listhandling;
using ICSharpCode.Reporting.Exporter.Visitors; using ICSharpCode.Reporting.Exporter.Visitors;
using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.Items;
using ICSharpCode.Reporting.PageBuilder.ExportColumns; using ICSharpCode.Reporting.PageBuilder.ExportColumns;
@ -36,7 +37,7 @@ namespace ICSharpCode.Reporting.Expressions
readonly Collection<ExportPage> pages; readonly Collection<ExportPage> pages;
readonly CollectionDataSource dataSource; readonly CollectionDataSource dataSource;
public ExpressionRunner(Collection<ExportPage> pages,ReportSettings reportSettings,CollectionDataSource dataSource){ public ExpressionRunner(Collection<ExportPage> pages,IReportSettings reportSettings,CollectionDataSource dataSource){
this.pages = pages; this.pages = pages;
this.dataSource = dataSource; this.dataSource = dataSource;
Visitor = new ExpressionVisitor(reportSettings); Visitor = new ExpressionVisitor(reportSettings);

3
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/AstExtensions.cs

@ -19,6 +19,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using ICSharpCode.Reporting.DataManager.Listhandling; using ICSharpCode.Reporting.DataManager.Listhandling;
using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Interfaces.Export; using ICSharpCode.Reporting.Interfaces.Export;
using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.Items;
using ICSharpCode.Reporting.PageBuilder.ExportColumns; 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) if (reportSettings == null)
throw new ArgumentNullException("reportSettings"); throw new ArgumentNullException("reportSettings");
app.Globals.Add("ReportSettings",reportSettings); app.Globals.Add("ReportSettings",reportSettings);

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/IReportModel.cs

@ -28,7 +28,7 @@ namespace ICSharpCode.Reporting.Interfaces
/// </summary> /// </summary>
public interface IReportModel public interface IReportModel
{ {
ReportSettings ReportSettings {get;set;} IReportSettings ReportSettings {get;set;}
Collection<BaseSection> SectionCollection {get;} Collection<BaseSection> SectionCollection {get;}
IReportContainer ReportHeader {get;} IReportContainer ReportHeader {get;}
IReportContainer PageHeader {get;} IReportContainer PageHeader {get;}

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportModel.cs

@ -62,7 +62,7 @@ namespace ICSharpCode.Reporting.Items
#endregion #endregion
public ReportSettings ReportSettings{get;set;} public IReportSettings ReportSettings{get;set;}
public Collection<BaseSection> SectionCollection {get; private set;} public Collection<BaseSection> SectionCollection {get; private set;}
} }

5
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs

@ -33,6 +33,7 @@ namespace ICSharpCode.Reporting.Items
/// <summary> /// <summary>
/// Description of ReportSettings. /// Description of ReportSettings.
/// </summary> /// </summary>
/*
public class ReportSettingsDesigner:ComponentDesigner public class ReportSettingsDesigner:ComponentDesigner
{ {
const string settingsName = "ReportSettings"; const string settingsName = "ReportSettings";
@ -46,9 +47,9 @@ namespace ICSharpCode.Reporting.Items
component.Site.Name = ReportSettingsDesigner.settingsName; component.Site.Name = ReportSettingsDesigner.settingsName;
} }
} }
*/
// [Designer(typeof(ReportSettingsDesigner))]
[Designer(typeof(ReportSettingsDesigner))]
public class ReportSettings:Component,IReportSettings public class ReportSettings:Component,IReportSettings
{ {

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/BasePageBuilder.cs

@ -201,7 +201,7 @@ namespace ICSharpCode.Reporting.PageBuilder
#region Visitors #region Visitors
protected void SetupExpressionRunner (ReportSettings reportsettings,CollectionDataSource dataSource){ protected void SetupExpressionRunner (IReportSettings reportsettings,CollectionDataSource dataSource){
ExpressionRunner = new ExpressionRunner(Pages,reportsettings,dataSource); ExpressionRunner = new ExpressionRunner(Pages,reportsettings,dataSource);
} }

5
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/PreviewViewModel.cs

@ -21,6 +21,7 @@ using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Documents; using System.Windows.Documents;
using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Items; using ICSharpCode.Reporting.Items;
using ICSharpCode.Reporting.PageBuilder.ExportColumns; using ICSharpCode.Reporting.PageBuilder.ExportColumns;
using ICSharpCode.Reporting.WpfReportViewer.Visitor; using ICSharpCode.Reporting.WpfReportViewer.Visitor;
@ -35,7 +36,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer
FixedDocument document ; FixedDocument document ;
public PreviewViewModel(ReportSettings reportSettings, Collection<ExportPage> pages) public PreviewViewModel(IReportSettings reportSettings, Collection<ExportPage> pages)
{ {
if (pages == null) if (pages == null)
throw new ArgumentNullException("pages"); throw new ArgumentNullException("pages");
@ -49,7 +50,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer
this.Document = wpfExporter.Document; this.Document = wpfExporter.Document;
} }
static FixedDocument CreateFixedDocument(ReportSettings reportSettings) static FixedDocument CreateFixedDocument(IReportSettings reportSettings)
{ {
var document = new FixedDocument(); var document = new FixedDocument();
document.DocumentPaginator.PageSize = new System.Windows.Size(reportSettings.PageSize.Width, document.DocumentPaginator.PageSize = new System.Windows.Size(reportSettings.PageSize.Width,

Loading…
Cancel
Save