-
Notifications
You must be signed in to change notification settings - Fork 0
/
XpsPreviewControl.cs
47 lines (43 loc) · 979 Bytes
/
XpsPreviewControl.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Author: Jason Jimenez
* Date : 5/7/2007 6:11PM
*
*/
using System;
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows.Forms.Integration;
using JasonJimenez.ClassicReport.Xps;
namespace JasonJimenez.ClassicReport
{
public partial class XpsPreviewControl : System.Windows.Forms.UserControl
{
ElementHost host;
DocumentViewer viewer;
//ClassicReportDocument doc;
public XpsPreviewControl()
{
InitializeComponent();
viewer = new DocumentViewer();
host = new ElementHost();
host.Dock = System.Windows.Forms.DockStyle.Fill;
host.Child = viewer;
Controls.Add(host);
}
[Browsable(false)]
public ClassicReportDocument Document
{
//get { return doc; }
set
{
//doc = value;
if (value != null)
{
XpsService xps = new XpsService(value);
xps.Populate();
viewer.Document = xps.DocumentSequence;
}
}
}
}
}