-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.vb
46 lines (40 loc) · 1.97 KB
/
Form1.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
Imports System
Imports System.Linq
Imports System.Drawing
Imports System.Windows.Forms
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraEditors
Namespace WindowsApplication1
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
radioGroup1.Properties.Items(0).Value = ReportGeneratorType.SinglePage
radioGroup1.Properties.Items(1).Value = ReportGeneratorType.FixedColumnWidth
radioGroup1.Properties.Items(2).Value = ReportGeneratorType.BestFitColumns
radioGroup1.EditValue = ReportGeneratorType.SinglePage
End Sub
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim rep As XtraReport = GenerateReport(pivotGridControl1, CType(radioGroup1.EditValue, ReportGeneratorType), Convert.ToInt32(spinEdit1.EditValue), checkEdit2.Checked)
rep.ShowPreviewDialog()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
customerReportsTableAdapter.Fill(nwindDataSet.CustomerReports)
fieldProductName1.FilterValues.ValuesIncluded = fieldProductName1.GetUniqueValues().Take(7).ToArray()
pivotGridControl1.BestFit()
End Sub
Private Sub radioGroup1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
Select Case CType(CType(sender, RadioGroup).EditValue, ReportGeneratorType)
Case ReportGeneratorType.SinglePage
spinEdit1.Enabled = False
checkEdit2.Enabled = False
Case ReportGeneratorType.FixedColumnWidth
spinEdit1.Enabled = True
checkEdit2.Enabled = True
Case ReportGeneratorType.BestFitColumns
spinEdit1.Enabled = False
checkEdit2.Enabled = True
End Select
End Sub
End Class
End Namespace