Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Passing a value as a paramter Post Reply Post New Topic
Author Message
Essel
Newbie
Newbie


Joined: 14 Dec 2010
Online Status: Offline
Posts: 5
Quote Essel Replybullet Topic: Passing a value as a paramter
    Posted: 14 Dec 2010 at 11:19pm
Please i need some help about this problem.i want to pass an integer value as a paramater to my report using this code
cryRpt.Load(Application.StartupPath & "\SpecificAreaReport.rpt")
            
            Dim crParameterFieldDefinitions As ParameterFieldDefinitions
            Dim crParameterFieldDefinition As ParameterFieldDefinition
            Dim crParameterValues As New ParameterValues
            Dim crParameterDiscreteValue As New ParameterDiscreteValue

            crParameterDiscreteValue.Value = Me.AreaNameTextBox.Text
            crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
            crParameterFieldDefinition = crParameterFieldDefinitions.Item("empID")
            crParameterValues = crParameterFieldDefinition.CurrentValues
            crParameterValues.Clear()
            crParameterValues.Add(crParameterDiscreteValue)
            crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

The problem is when i run this code it gives me a COM Exception which i dont understand why it is giving me that exception at this line---- crParameterFieldDefinition = crParameterFieldDefinitions.Item("empID")
Please help me.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.