cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a Parameter to a CR XI

Former Member
0 Kudos

I have created a report in Crystal Report XI

I have an application (VB6) which captures values and I would like to pass these parameters to this report in oder to determine the selection process

i.e.

I want to pass an "order number" to this report in order for the report to select data based on this input.

VB code is as follows

Function CReport_DC(ml_no As Integer, ls_no As Integer)

Dim CrApps As CRAXDRT.Application

Dim CrRep As CRAXDRT.Report

Set CrApps = New CRAXDRT.Application

Set CrRep = CrApps.OpenReport("C:\MyReports\CC.rpt")

CrRep.DiscardSavedData

CrRep.ParameterFields.GetItemByName("Master_Load_No").AddCurrentValue ml_no

'CrRep.ParameterFields.GetItemByName("Load_Stop_No").AddCurrentValue ls_no

Screen.MousePointer = vbHourglass

CRViewer.ReportSource = CrRep

CRViewer.ViewReport

Screen.MousePointer = vbDefault

Set CrRep = Nothing

Set CrApps = Nothing

End Function

I receive the following error

error -2147189582 Invalid Name

I obviously need to link my parm "ml_no" and "ls_no" to valids name within the report but I do not know how?

Can someone please please help?

Accepted Solutions (1)

Accepted Solutions (1)

former_member208657
Active Contributor
0 Kudos

This should be straight forward. You need to open the report in the Crystal designer and look at the parameters in your Field Explorer. The parameter name you reference in code needs to match what you find in your report design.

Have you confirmed this?

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

An obvious assumption, but one that needs to be confirmed;

1) "Master_Load_No" and "Load_Stop_No" are Parameter Fields that do exist in the report?

2) When you run the report in the CR designer, you are able to pass in the values "ml_no" and "ls_no" successfully?

And couple of questions;

1) What CR SP are you on?

2) This is happening on your dev computer?

Ludek

Former Member
0 Kudos

Thanks for your speedy reply, answer was provided by Marketing rep.

Need to know if there is a manual for CR XI documenting Functions and Features?

former_member183750
Active Contributor
former_member208657
Active Contributor
0 Kudos

If you want help with the features inside the Crystal Reports designer you can simply press F1 when working with the Crystal Reports designer. This will bring up the help guide.

Or, you can check out [here|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm] for developer info.