-
Notifications
You must be signed in to change notification settings - Fork 0
/
XtraReport1.vb
43 lines (41 loc) · 1.24 KB
/
XtraReport1.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
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraPrinting
Imports DevExpress.XtraPrinting.NativeBricks
Namespace dx_sample
Partial Public Class XtraReport1
Inherits DevExpress.XtraReports.UI.XtraReport
Private DetailHeight As Single = 0
Public Sub New()
InitializeComponent()
End Sub
Public Sub CreateCustomDocument()
CreateDocument()
xrTable2.BeginInit()
xrTable2.HeightF = DetailHeight
xrTable2.EndInit()
CreateDocument()
End Sub
Protected Overrides Sub AfterReportPrint()
If DetailHeight <> 0 Then
Return
End If
For Each p As DevExpress.XtraPrinting.Page In Me.Pages
For Each b As Brick In p
If TypeOf b Is TableBrick Then
DetailHeight = Math.Max(DetailHeight, b.Size.Height)
End If
Next b
Next p
Select Case Me.ReportUnit
Case ReportUnit.HundredthsOfAnInch
DetailHeight = 100 * GraphicsUnitConverter.Convert(DetailHeight, GraphicsUnit.Document, GraphicsUnit.Inch)
Case ReportUnit.TenthsOfAMillimeter
DetailHeight = 10 * GraphicsUnitConverter.Convert(DetailHeight, GraphicsUnit.Document, GraphicsUnit.Millimeter)
End Select
End Sub
End Class
End Namespace