Hi.
- place a CrystalReportViewer control on a form
- a button
- a combobox
in the following code,
the user selects a value in the combo (wich is first bind to a datasource, datamember etc..)
press the button and the viewer loads the
report passing the combo selection as parameter
then no popup is needed.
here is the code: hope this helps.
with thanks to the 'DragonsHouse'.
--------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
CrystalReportViewer1.ParameterFieldInfo = Nothing
CrystalReportViewer1.ReportSource = Nothing
paramField = New ParameterField
descreteVal = New ParameterDiscreteValue
paramField.ParameterFieldName = "ClientName"
descreteVal.Value = Me.CMB_ClientName.SelectedValue
paramField.CurrentValues.Add(descreteVal)
paramFields.Add(paramField)
CrystalReportViewer1.ParameterFieldInfo = paramFields
Dim a As New crCustomerByWorkers ' the rpt file
CrystalReportViewer1.ReportSource = a
End Sub
|