• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 302
  • Last Modified:

pass val from vb to crystal report

i have a stored procedure with single parameter. From crystal report when i pass the parameter i get the output. but i cannot pass the parameter from vb to this crystal report. PLS HELP

Dim CrApp As CRAXDRT.Application
Dim CrRep As CRAXDRT.Report
Set CrApp = New CRAXDRT.Application
Set CrRep = CrApp.OpenReport("C:\JSM.rpt")

CrRep.ParameterFields.GetItemByName("@strOrderNo").AddCurrentValue "YIOP2795776"   ERROR HERE

CRViewer1.ReportSource = CrRep
CRViewer1.ViewReport
0
AnnaJames77
Asked:
AnnaJames77
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
is it the same question you posted 4 times?
0
 
mlmccCommented:
Try it as
CrRep.ParameterFields.GetItemByName("{?strOrderNo}").AddCurrentValue "YIOP2795776"

If that doesn't work add this to get the name

msgbox CrRep.ParameterFields(1).Name

Since it is the seems to be the only parameter
CrRep.ParameterFields(1).AddCurrentValue "YIOP2795776"

mlmcc
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now