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

Multiple params (Crystal Reports on ASP. Net)

Status
Not open for further replies.

jmerencilla

Programmer
Jul 17, 2002
123
SG
hi. i made a simple crystal report which accepts 2 paramters. however, when i try to run my page, i get this error below. i tried debugging this and i found that although the 2 paramters were added, only the value of the last parameter was reflected on the 2 paramter fields (ie. the 2 paramters now contain the value of the last paramter, including the parameter name!) can somebody here help me? i really need this report or my boss will kill me. thanks. :)

here's the error:

Missing parameter field current value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException: Missing parameter field current value.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

.
.
.



here's my code:

Protected WithEvents CRptViewer As
CrystalDecisions.Web.CrystalReportViewer

Dim objCRpt As New myCrptReport()
Dim paramFields As New CrystalDecisions.Shared.ParameterFields()
Dim paramField As New CrystalDecisions.Shared.ParameterField()
Dim discreteVal As New CrystalDecisions.Shared.ParameterDiscreteValue()
Dim rangeVal As New CrystalDecisions.Shared.ParameterRangeValue()

With paramField
.ParameterFieldName = "V_PAYGROUP"
discreteVal.Value = "TUESDAY"
.CurrentValues.Add(discreteVal)
paramFields.Add(paramField)
CRptViewer.ParameterFieldInfo = paramFields

.ParameterFieldName = "V_FMNO"
discreteVal.Value = "0004-0000-00002"
.CurrentValues.Add(discreteVal)
paramFields.Add(paramField)
CRptViewer.ParameterFieldInfo.Add(paramFields)
End With


 
it seems like you need to create 2 ParameterField objects. one for each parameter:

Protected WithEvents CRptViewer As
CrystalDecisions.Web.CrystalReportViewer

Dim objCRpt As New myCrptReport()
Dim paramFields As New CrystalDecisions.Shared.ParameterFields()
Dim paramField1 As New CrystalDecisions.Shared.ParameterField()
Dim paramField2 As New CrystalDecisions.Shared.ParameterField()
Dim discreteVal As New CrystalDecisions.Shared.ParameterDiscreteValue()
Dim rangeVal As New CrystalDecisions.Shared.ParameterRangeValue()

With paramField1
.ParameterFieldName = "V_PAYGROUP"
discreteVal.Value = "TUESDAY"
.CurrentValues.Add(discreteVal)
paramFields.Add(paramField1)
CRptViewer.ParameterFieldInfo = paramFields
End With
With paramField2
.ParameterFieldName = "V_FMNO"
discreteVal.Value = "0004-0000-00002"
.CurrentValues.Add(discreteVal)
paramFields.Add(paramField2)
CRptViewer.ParameterFieldInfo.Add(paramFields)
End With


hth and good luck! Daren J. Lahey
Just another computer guy...
 
thanks Daren. actually, i already thought of that. however, doing so generates yet another error "Failed to open a rowset". i know that my stored proc works fine with these same params but i dont understand why passing these params from a web form displays this error. would you know why? thanks again. :)
 
Where does the error point to your code? Give us a snipplet of your code so we can figure things out better.
Daren J. Lahey
Just another computer guy...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top