This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
/
Default.aspx.vb
120 lines (89 loc) · 3.48 KB
/
Default.aspx.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
Imports Microsoft.VisualBasic
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports DevExpress.Web
Namespace Exporter
Partial Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Protected Function SetGrid() As String
If ASPxRadioButtonList1.Value.ToString() = "c" Then
Return ASPxGridView1.ID
Else
Return ASPxGridView2.ID
End If
End Function
Protected Sub SetHeaderStyle()
If ASPxRadioButtonList2.Value.ToString() = "r" Then
ASPxGridViewExporter1.Styles.Header.BackColor = System.Drawing.Color.Red
ASPxGridViewExporter1.Styles.Header.ForeColor = System.Drawing.Color.MistyRose
End If
If ASPxRadioButtonList2.Value.ToString() = "b" Then
ASPxGridViewExporter1.Styles.Header.BackColor = System.Drawing.Color.Navy
ASPxGridViewExporter1.Styles.Header.ForeColor = System.Drawing.Color.White
End If
If ASPxRadioButtonList2.Value.ToString() = "g" Then
ASPxGridViewExporter1.Styles.Header.BackColor = System.Drawing.Color.Green
ASPxGridViewExporter1.Styles.Header.ForeColor = System.Drawing.Color.PaleGreen
End If
End Sub
Protected Sub ASPxButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
SetHeaderStyle()
ASPxGridViewExporter1.GridViewID = SetGrid()
ASPxGridViewExporter1.WriteXlsToResponse()
End Sub
Protected Sub ASPxGridViewExporter1_RenderBrick(ByVal sender As Object, ByVal e As ASPxGridViewExportRenderingEventArgs)
' #Region "Styles"
If ASPxRadioButtonList2.Value.ToString() = "r" Then
If e.RowType = DevExpress.Web.GridViewRowType.Title Then
e.BrickStyle.BackColor = System.Drawing.Color.DarkRed
e.BrickStyle.ForeColor = System.Drawing.Color.MistyRose
End If
If e.RowType = DevExpress.Web.GridViewRowType.Data Then
e.BrickStyle.BackColor = System.Drawing.Color.MistyRose
e.BrickStyle.ForeColor = System.Drawing.Color.Black
End If
End If
If ASPxRadioButtonList2.Value.ToString() = "b" Then
If e.RowType = DevExpress.Web.GridViewRowType.Title Then
e.BrickStyle.BackColor = System.Drawing.Color.DarkBlue
e.BrickStyle.ForeColor = System.Drawing.Color.SteelBlue
End If
If e.RowType = DevExpress.Web.GridViewRowType.Data Then
e.BrickStyle.BackColor = System.Drawing.Color.SteelBlue
e.BrickStyle.ForeColor = System.Drawing.Color.White
End If
End If
If ASPxRadioButtonList2.Value.ToString() = "g" Then
If e.RowType = DevExpress.Web.GridViewRowType.Title Then
e.BrickStyle.BackColor = System.Drawing.Color.DarkGreen
e.BrickStyle.ForeColor = System.Drawing.Color.PaleGreen
End If
If e.RowType = DevExpress.Web.GridViewRowType.Data Then
e.BrickStyle.BackColor = System.Drawing.Color.PaleGreen
e.BrickStyle.ForeColor = System.Drawing.Color.Black
End If
End If
' #End Region
End Sub
Protected Sub ASPxButton2_Click(ByVal sender As Object, ByVal e As EventArgs)
SetHeaderStyle()
ASPxGridViewExporter1.GridViewID = SetGrid()
ASPxGridViewExporter1.WritePdfToResponse()
End Sub
Protected Sub ASPxButton3_Click(ByVal sender As Object, ByVal e As EventArgs)
SetHeaderStyle()
ASPxGridViewExporter1.GridViewID = SetGrid()
ASPxGridViewExporter1.WriteRtfToResponse()
End Sub
End Class
End Namespace