I have a problem using parameters with Crystal reports.
I have a report based on Access query which is similar to something like following
"SELECT * from StudentMain where StudentID=ParaStudentID"
I have a crystal report which is based on the above query so that my users can print details of selected students.
The problem is that every time I run the report Crystal reports prompts to enter a value for ParaStudentID (database query field).
I have passed the value of this field through my program as follows
Dim crReportDocument As New ReportDocument
crReportDocument.Load("C:\StudentDetails.rpt")
Dim RptParameterFields As New ParameterFields
Dim ParaStID As New ParameterField
Dim RptDiscreteValue As New ParameterDiscreteValue
ParaStID.ParameterFieldName = "ParaStudentID"
RptDiscreteValue.Value = Me.txtStudentID.Text
ParaStID.CurrentValues.Add(myDiscreteValue)
RptParameterFields.Add(ParaStID)
Dim fReportViewer As New frmReportViewer
fReportViewer.CRREportViewer1.ReportSource = crReportDocument
I'm bit confused with the parameter field in Crystal report and the paramater of my query. If I want my report to display different student details, which parameter I should use in the report?
Can any one help me to resolve this please?
Thanks in advance.
I have a report based on Access query which is similar to something like following
"SELECT * from StudentMain where StudentID=ParaStudentID"
I have a crystal report which is based on the above query so that my users can print details of selected students.
The problem is that every time I run the report Crystal reports prompts to enter a value for ParaStudentID (database query field).
I have passed the value of this field through my program as follows
Dim crReportDocument As New ReportDocument
crReportDocument.Load("C:\StudentDetails.rpt")
Dim RptParameterFields As New ParameterFields
Dim ParaStID As New ParameterField
Dim RptDiscreteValue As New ParameterDiscreteValue
ParaStID.ParameterFieldName = "ParaStudentID"
RptDiscreteValue.Value = Me.txtStudentID.Text
ParaStID.CurrentValues.Add(myDiscreteValue)
RptParameterFields.Add(ParaStID)
Dim fReportViewer As New frmReportViewer
fReportViewer.CRREportViewer1.ReportSource = crReportDocument
I'm bit confused with the parameter field in Crystal report and the paramater of my query. If I want my report to display different student details, which parameter I should use in the report?
Can any one help me to resolve this please?
Thanks in advance.