This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
XtraReport1.vb
53 lines (45 loc) · 1.58 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
44
45
46
47
48
49
50
51
52
53
Imports Microsoft.VisualBasic
Imports System
#Region "#Reference"
Imports DevExpress.Utils
Imports DevExpress.XtraReports.Parameters
Imports DevExpress.XtraReports.UI
' ...
#End Region ' #Reference
Namespace DynamicParameterValues
#Region "#Code"
Partial Public Class XtraReport1
Inherits XtraReport
Public Sub New()
InitializeComponent()
' Create a parameter and define its main properties.
Dim parameter1 As New Parameter()
parameter1.Type = GetType(System.Int32)
parameter1.Name = "parameterProduct"
parameter1.Visible = True
parameter1.Description = "Product Name: "
' Adjust the look-up settings to obtain
' the parameter values from the report's data source.
Dim lookUpSettings As New DynamicListLookUpSettings()
lookUpSettings.DataSource = Me.DataSource
lookUpSettings.DataAdapter = Me.DataAdapter
lookUpSettings.DataMember = "Products"
lookUpSettings.DisplayMember = "ProductName"
lookUpSettings.ValueMember = "ProductID"
parameter1.LookUpSettings = lookUpSettings
' Add the parameter to the report's collection,
' and filter the report based on the parameter's value.
Me.Parameters.Add(parameter1)
Me.FilterString = "[ProductID] = ?parameterProduct"
' Display the current parameter value in the report.
Dim label As New XRLabel()
Me.Detail.Controls.Add(label)
label.DataBindings.Add(New XRBinding(parameter1, "Text", ""))
label.LocationFloat = New PointFloat(377.0833F, 10.00001F)
' Pass a value to the parameter and publish the report.
parameter1.Value = 1
Me.RequestParameters = False
End Sub
End Class
#End Region ' #Code
End Namespace