954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Passing Values to Crystal Reports using VB.NET,ADO.NET

Hi, i am biggener to VB.NET and ADO.NET. I have created a VB.NET form contains "Date From" and "Date To". i want to pass these two range parameters to crystal reports to manipulate the result. What is the way to do so using ADO.NET. Kindly some one explain Step by Step. Thanks in Advance

saquibaltaf
Newbie Poster
8 posts since Jul 2007
Reputation Points: 10
Solved Threads: 0
 
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("Orderdate")
        crParameterValues = crParameterFieldDefinition.CurrentValues

        crParameterValues.Clear()
        crParameterValues.Add(crParameterDiscreteValue)
        crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)


if want to know more detail about this check this link. http://vb.net-informations.com/crystal-report/vb.net_crystal_report_parameter_date.htm

bruce

bruce2424
Newbie Poster
23 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

hi bro,
I have gone thru it and it seems to b a lil help to me.,and btw,my actual requirement is i have to add a new filed "Total cost" in crystal report which is not a field in DB,its a dynamic variable which shld get reflected in the report..,Help please..,
many thanks..

vammy
Light Poster
44 posts since Nov 2011
Reputation Points: 8
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You