











' http://msdn2.microsoft.com/en-us/library/aa289936(VS.71).aspx
Imports Crystaldecisions.shared
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim paramFields As New ParameterFields()
Dim paramField As New ParameterField()
Dim discreteVal As New ParameterDiscreteValue()
paramField.ParameterFieldName = "tt"
discreteVal.Value = Val(Form2.TextBox1.Text)
paramField.CurrentValues.Add(discreteVal)
paramFields.Add(paramField)
CrystalReportViewer1.ParameterFieldInfo = paramFields
CrystalReportViewer1.ReportSource = "C:\Documents and Settings\burin\My Documents\Visual Studio 2005\Projects\WindowsApplication5\WindowsApplication5\CrystalReport1.rpt"
CrystalReportViewer1.Refresh()
End Sub
End Class
|