Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: passing parameter to CR document Post Reply Post New Topic
Author Message
yotta
Newbie
Newbie


Joined: 08 Jun 2009
Location: Algeria
Online Status: Offline
Posts: 2
Quote yotta Replybullet Topic: passing parameter to CR document
    Posted: 19 Nov 2009 at 1:23pm
hi
i am getting a real troule with my code, i would like to pass a parameter to my crystal Repot document from my code(i am programming wi VB.NET VS2005)
my code in the following:
 
 
 
 

Dim cryRpt As New ReportDocument

cryRpt.Load("D:\imp_bon_reception.rpt", OpenReportMethod.OpenReportByDefault)

Dim crParameterFieldDefinitions As ParameterFieldDefinitions

Dim crParameterFieldDefinition As ParameterFieldDefinition

Dim crParameterValues As New ParameterValues

Dim crParameterDiscreteValue As New ParameterDiscreteValue

crParameterDiscreteValue.Value = Convert.ToInt32(bon_reception.TextB_num.Text)

crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields

crParameterFieldDefinition = crParameterFieldDefinitions.Item("num_br")

crParameterValues = crParameterFieldDefinition.CurrentValues

crParameterValues.Clear()

crParameterValues.Add(crParameterDiscreteValue)

crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

CrystalReportViewer1.ReportSource = cryRpt

CrystalReportViewer1.Refresh()

 
 
 
 
 
but i got the fellowing error message in the bold line:
 
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CrystalDecisions.CrystalReports.Engine.dll

Additional information: Index non valide. (Exception de HRESULT : 0x8002000B (DISP_E_BADINDEX))
 
 can you help me to solve this problem ?
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.016 seconds.