hi..
can anybody help me in passing date parameters into crystal report?
i wanna do something like the user types in the date and clicks on the OK button to view the crystal report according to the date typed by the user..
below is my codings..
but there's this error upon clicking the OK button..
"Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)"
at the bolded lines below..
Code:Private Sub btn_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_ok.Click Dim cryRpt As New ReportDocument cryRpt.Load("C:\CrystalReport3.rpt") Dim crParameterFieldDefinitions As ParameterFieldDefinitions Dim crParameterFieldDefinition As ParameterFieldDefinition Dim crParameterValues As New ParameterValues Dim crParameterDiscreteValue As New ParameterDiscreteValue crParameterDiscreteValue.Value = TextBox1.Text crParameterFieldDefinitions = _ cryRpt.DataDefinition.ParameterFields crParameterFieldDefinition = _ crParameterFieldDefinitions.Item("DealDate") crParameterValues = crParameterFieldDefinition.CurrentValues crParameterValues.Clear() crParameterValues.Add(crParameterDiscreteValue) crParameterFieldDefinition.ApplyCurrentValues(crParameterValues) TestReport.CrystalReportViewer1.ReportSource = cryRpt TestReport.CrystalReportViewer1.Refresh() End Sub
can anyone help me in solving the problem?
=/
i appreciate any help
Thanks alot!!![]()




Reply With Quote