-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm1.vb
More file actions
67 lines (52 loc) · 2.6 KB
/
Form1.vb
File metadata and controls
67 lines (52 loc) · 2.6 KB
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
Imports System
Imports System.Windows.Forms
Imports System.Drawing
Imports DevExpress.XtraPrinting
' ...
Namespace NonPrintBrick
Partial Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub btn_NonPrintableBrick_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_NonPrintableBrick.Click
Dim graph As BrickGraphics = printingSystem1.Graph
' Start the report generation.
printingSystem1.Begin()
' Set the modifier - specify the page area.
graph.Modifier = BrickModifier.MarginalHeader
Dim format As String = "Page {0} of {1}"
graph.Font = graph.DefaultFont
graph.BackColor = Color.Transparent
Dim r As New RectangleF(0, 0, 0, CType(graph.Font, Font).Height)
' Create a brick.
Dim brick As PageInfoBrick = graph.DrawPageInfo(PageInfo.NumberOfTotal, format, Color.Black, r, BorderSide.None)
brick.Alignment = BrickAlignment.Far
brick.AutoWidth = True
' Create another brick with different alignment.
brick = graph.DrawPageInfo(PageInfo.DateTime, "{0:MMMM dd}", Color.Black, r, BorderSide.None)
' Change the page area - set the modifier.
printingSystem1.Graph.Modifier = BrickModifier.DetailHeader
graph.BackColor = Color.Silver
' Create a brick, which will be hidden in the printout.
Dim tBrick As New TextBrick(BorderSide.None, 1, Color.Black, Color.Khaki, Color.Blue)
tBrick.Url = "http://www.devexpress.com"
tBrick.Text = "Click here to visit our web site"
tBrick.CanPublishToFormats = CanPublishToFormats.None
printingSystem1.Graph.DrawBrick(tBrick, New RectangleF(0, 0, 200, 20))
' Create a brick - a column header.
printingSystem1.Graph.DrawString("Report Items", Color.Black, New RectangleF(0, 20, 200, 20), BorderSide.All)
' Change the page area - set the modifier.
printingSystem1.Graph.Modifier = BrickModifier.Detail
graph.BackColor = Color.White
' Create bricks.
For i As Integer = 0 To 99
printingSystem1.Graph.DrawString("Item N" & Convert.ToString(i + 1), Color.Black, New RectangleF(0, 20 * i, 200, 20), BorderSide.All)
Next i
' Finish the report generation.
printingSystem1.End()
' Preview the report.
printingSystem1.PreviewFormEx.Show()
End Sub
End Class
End Namespace