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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports - multiple parameters - Invalid object type

Status
Not open for further replies.

HomerJS

Programmer
Jun 25, 2001
86
US
Any help would be appreciated with what I'm doing wrong to get the following error in the related code below:


ERROR ================================

Exception Details: System.ArgumentException: Invalid object type.

Source Error:

Line 61: .CurrentValues.Add(discreteVal)
Line 62: paramFields.Add(parmSettleNo)
Line 63: crvSettled.ParameterFieldInfo.Add(paramFields)
Line 64: End With

Source File: c:\inetpub\ Line: 63


CODE ================================

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objCRpt As New CRSettled()
Dim paramFields As New CrystalDecisions.Shared.ParameterFields()
Dim parmDriver As New CrystalDecisions.Shared.ParameterField()
Dim parmSettleNo As New CrystalDecisions.Shared.ParameterField()
Dim parmPswd As New CrystalDecisions.Shared.ParameterField()
Dim discreteVal As New CrystalDecisions.Shared.ParameterDiscreteValue()

With parmDriver
.ParameterFieldName = "DriverParm"
discreteVal.Value = "12345"
.CurrentValues.Add(discreteVal)
paramFields.Add(parmDriver)
crvSettled.ParameterFieldInfo = paramFields
End With

With parmSettleNo
.ParameterFieldName = "SettleParm"
discreteVal.Value = "987"
.CurrentValues.Add(discreteVal)
paramFields.Add(parmSettleNo)
crvSettled.ParameterFieldInfo.Add(paramFields)
End With

DataBind()
End Sub
 
I am new to Crystal Report. I'm using CR 8.5. My problem has to do with multiple parameters. The user can select multiple offices that have setup as multiple parameters to print the report. Office is 2 alpha chars field. Like: 10, 20, 30, 40.

I can use the Join function to print multiple paramters
at top of the report but only 1st office get included in the report. How can I code this in Formula?

If anyone can provide me a code that will help. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top