I am trying to pass a parameter to a Crystal Report. If I remove the parameter and alter the code appropriately, the report displays fine. Most of the code I am using below is copied directly from the online help within VS.NET but I am getting the error message, "Missing parameter field current value."?? Can someone please help me?
Thanks,
Dana
Imports CrystalDecisions.Shared
Public Class MoviesRpt
Inherits System.Web.UI.Page
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer
#Region " Web Form Designer Generated Code "
This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
CODEGEN: This method call is required by the Web Form Designer
Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim paramFields As New ParameterFields()
Dim paramField As New ParameterField()
Dim discreteVal As New ParameterDiscreteValue()
paramField.ParameterFieldName = "prm_sort_order"
discreteVal.Value = "C"
paramField.CurrentValues.Add(discreteVal)
paramField.ReportName = "C:\Inetpub\wwwroot\Movies\CR_MoviesRpt.rpt"
paramFields.Add(paramField)
CrystalReportViewer1.ReportSource = "C:\Inetpub\wwwroot\Movies\CR_MoviesRpt.rpt"
CrystalReportViewer1.ParameterFieldInfo = paramFields
CrystalReportViewer1.DataBind()
End Sub
End Class
Thanks,
Dana
Imports CrystalDecisions.Shared
Public Class MoviesRpt
Inherits System.Web.UI.Page
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer
#Region " Web Form Designer Generated Code "
This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
CODEGEN: This method call is required by the Web Form Designer
Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim paramFields As New ParameterFields()
Dim paramField As New ParameterField()
Dim discreteVal As New ParameterDiscreteValue()
paramField.ParameterFieldName = "prm_sort_order"
discreteVal.Value = "C"
paramField.CurrentValues.Add(discreteVal)
paramField.ReportName = "C:\Inetpub\wwwroot\Movies\CR_MoviesRpt.rpt"
paramFields.Add(paramField)
CrystalReportViewer1.ReportSource = "C:\Inetpub\wwwroot\Movies\CR_MoviesRpt.rpt"
CrystalReportViewer1.ParameterFieldInfo = paramFields
CrystalReportViewer1.DataBind()
End Sub
End Class