This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
/
PreviewControl.vb
66 lines (57 loc) · 1.49 KB
/
PreviewControl.vb
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Data
Imports System.Text
Imports System.Windows.Forms
Imports DevExpress.XtraEditors
Imports DevExpress.XtraReports.UI
Imports Contacts.Reports
Namespace Contacts.Controls
Partial Public Class PreviewControl
Inherits XtraUserControl
Implements IControl
Private _url As String
Public Sub New(Optional ByVal url As String = Nothing)
InitializeComponent()
_url = url
End Sub
Private privateId As Integer
Public Property Id() As Integer Implements IControl.Id
Get
Return privateId
End Get
Set(ByVal value As Integer)
privateId = value
End Set
End Property
Public ReadOnly Property IsDirty() As Boolean Implements IControl.IsDirty
Get
Return True
End Get
End Property
Public Sub Save() Implements IControl.Save
Return
End Sub
Public Sub Reload() Implements IControl.Reload
If _url IsNot Nothing Then
Dim report = XtraReport.FromFile(_url, True)
If TypeOf report Is IReport Then
TryCast(report, IReport).LoadDataSource()
End If
printControl1.PrintingSystem = report.PrintingSystem
report.CreateDocument()
End If
End Sub
Public Function Delete() As Integer Implements IControl.Delete
Return -1
End Function
Public ReadOnly Property TabType() As TabType Implements IControl.TabType
Get
Return TabType.Preview
End Get
End Property
End Class
End Namespace