Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot edit a parameter and cannot assign value at run time

Status
Not open for further replies.

forumhelp

Programmer
Dec 13, 2005
17
US
Hi Everyone,

I am working on crystal reports XI and there is a parameter which I can neither delete nor I can pass a value in this parameter from visual basic at run time. I want to use the parameter and the same parameter is being passed to other sub reports. While changing the datasource location if I set it to Null then while running the report, it prompts to enter a value in the parameter and if I enter if manually then it is working fine.
Any idea why is it happening?
 
with crxrpt
For intI = 1 To .ParameterFields.count
sRptName = LCase(.ParameterFields(intI).Name)
If sRptName = "{?@hostname}" Then
.ParameterFields(intI).AddCurrentValue (gsHostName)
End If
If sRptName = "{?@hostname1}" Then
.ParameterFields(intI).AddCurrentValue (gsHostName)
End If
If sRptName = "{?clientname}" Then
.ParameterFields(intI).AddCurrentValue (gsApplicationName)
End If
Next intI

end with

I have two parameters, when the code faces the first parameter, the following statement in the immediate window returns nothing.
?crxrpt.parameterfields(intI).getnthcurrentvalue(1)

The above statement in the immediate window returns a value of client name when the code loops the second time through the parameter "ClientName". I am not sure why I cannot assign a value to the first parameter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top