|
-
Nov 4th, 2008, 12:49 AM
#1
Thread Starter
New Member
help in Passing Date parameters into crystal report
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!!
Last edited by xiaoting; Nov 4th, 2008 at 12:54 AM.
-
Nov 4th, 2008, 05:11 AM
#2
New Member
Re: help in Passing Date parameters into crystal report
Hi
Not sure if you can use "ParamName" type index. Try using 1 for first parameter, 2 for second parameters etc.
HTH
Daz
-
Nov 7th, 2008, 02:03 AM
#3
Thread Starter
New Member
Re: help in Passing Date parameters into crystal report
hi thanks for your reply!
(:
i managed to solve the problem already it's because of the ("DealDate") which doesn't exist in my CR.. =x
thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|