Dim CR As New ReportDocument CR.Load(Application.StartupPath + "\IDcr.rpt") ' ' Declare the parameter related objects. ' Dim crParameterDiscreteValue As ParameterDiscreteValue Dim crParameterFieldDefinitions As ParameterFieldDefinitions Dim crParameterFieldLocation As ParameterFieldDefinition Dim crParameterValues As ParameterValues ' ' Get the report's parameters collection. DirectCast(CR.ReportDefinition.ReportObjects("Text9"), TextObject).Text = txtName.Text DirectCast(CR.ReportDefinition.ReportObjects("Text11"), TextObject).Text = txtAddress.Text DirectCast(CR.ReportDefinition.ReportObjects("Text12"), TextObject).Text = txtBarcode.Text ' crParameterFieldDefinitions = CR.DataDefinition.ParameterFields ' ' Set the first parameter ' - Get the parameter, tell it to use the current values vs default value. ' - Tell it the parameter contains 1 discrete value vs multiple values. ' - Set the parameter's value. ' - Add it and apply it. ' - Repeat these statements for each parameter. ' crParameterFieldLocation = crParameterFieldDefinitions.Item("MemPic") crParameterValues = crParameterFieldLocation.CurrentValues crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue crParameterDiscreteValue.Value = txtSID.Text crParameterValues.Add(crParameterDiscreteValue) crParameterFieldLocation.ApplyCurrentValues(crParameterValues) ' ' Set the Crytal Report Viewer control's source to the report document. ' frmPrintID.CrystalReportViewer1.ReportSource = CR frmPrintID.Show() Me.Close()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)