Imports Crystaldecisions.shared
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
CrystalReportViewer1.Refresh()
Dim paramFields As New ParameterFields()
Dim paramField As New ParameterField()
Dim discreteVal As New ParameterDiscreteValue()
'
paramField.ParameterFieldName = "t1"
discreteVal.Value = Val(TextBox2.Text)
paramField.CurrentValues.Add(discreteVal)
paramFields.Add(paramField)
'
discreteVal = New ParameterDiscreteValue()
paramField = New ParameterField()
'
paramField.ParameterFieldName = "t2"
discreteVal.Value = Val(TextBox1.Text)
paramField.CurrentValues.Add(discreteVal)
paramFields.Add(paramField)
CrystalReportViewer1.ParameterFieldInfo = paramFields
Dim rpt As String
rpt = "C:\pass2cryst\WindowsApplication1\WindowsApplication1\CrystalReport1.rpt"
CrystalReportViewer1.ReportSource = rpt
End Sub
End Class
|