1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using ICSharpCode.Core;
6
using ICSharpCode.Reports.Core;
7
using ICSharpCode.Reports.Core.Globals;
8
using ICSharpCode.SharpDevelop.Gui;
10
namespace ICSharpCode.Reports.Addin.SecondaryViews
13
/// Description of the view content
15
internal class ReportPreview : AbstractSecondaryViewContent
17
PreviewControl previewControl;
18
ReportDesignerLoader designerLoader;
20
StandartPreviewManager reportManager;
22
/// Creates a new ReportPreview object
25
public ReportPreview(ReportDesignerLoader loader,IViewContent content):base(content)
28
throw new ArgumentNullException("loader");
30
this.designerLoader = loader;
31
base.TabPageText = ResourceService.GetString("SharpReport.Preview");
35
protected override void LoadFromPrimary()
37
reportManager = new StandartPreviewManager();
38
ReportModel model = designerLoader.CreateRenderableModel();
39
AbstractRenderer rc = reportManager.CreateRenderer (model);
41
previewControl.ShowPreview(rc,GlobalValues.DefaultZoomFactor,true);
46
protected override void SaveToPrimary()
48
// throw new NotImplementedException();
53
/// The <see cref="System.Windows.Forms.Control"/> representing the view
55
public override object Control {
57
if (this.previewControl == null) {
58
previewControl = new PreviewControl();
60
return previewControl;
66
/// Cleans up all used resources
68
public sealed override void Dispose()
71
if (this.reportManager != null) {
72
this.reportManager.Dispose();
74
if (this.previewControl != null) {
75
previewControl.Dispose();