I have a crystal report with 3 sub reports in it. The main report has 2 parameters and the subs have 2 each. The parameters of the subs are same as that of main and the main and subs are linked. I developed the reports in a development database and now i want to implement this reports in many other production database. So i am setting the connection info dynamically while calling the report. And i am setting the parameter for the main report like this:
Private Sub addParameter(ByVal strParamName, ByVal strParamValue)
Dim pvParam As New CrystalDecisions.Shared.ParameterValues()
Dim pdvParam As New CrystalDecisions.Shared.ParameterDiscreteValue()
pdvParam.Value = strParamValue
pvParam.Add(pdvParam)
myRpt.DataDefinition.ParameterFields(strParamName).ApplyCurrentValues(pvParam)
End Sub
Private Sub Frm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
setConnectionInfo()
addParameter("@param1", "value1"
addParameter("@param2", "value2"
Me.CrystalReportViewer1.ReportSource = myRpt
Catch ex As Exception
MessageBox.Show("Error loading report :" + ex.Message, "Error", MessageBoxButtons.OK)
End Try
End Sub
But when i run the application to get the report it is prompting for the paramters 8 times and if i enter all the values there finally it gives the error message:
"report -----.rpt could not be submited for background processing"
I am using crystal 8.5, vb.net and sQl server.
Any idea?
thanks in advance
anurc
Private Sub addParameter(ByVal strParamName, ByVal strParamValue)
Dim pvParam As New CrystalDecisions.Shared.ParameterValues()
Dim pdvParam As New CrystalDecisions.Shared.ParameterDiscreteValue()
pdvParam.Value = strParamValue
pvParam.Add(pdvParam)
myRpt.DataDefinition.ParameterFields(strParamName).ApplyCurrentValues(pvParam)
End Sub
Private Sub Frm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
setConnectionInfo()
addParameter("@param1", "value1"
addParameter("@param2", "value2"
Me.CrystalReportViewer1.ReportSource = myRpt
Catch ex As Exception
MessageBox.Show("Error loading report :" + ex.Message, "Error", MessageBoxButtons.OK)
End Try
End Sub
But when i run the application to get the report it is prompting for the paramters 8 times and if i enter all the values there finally it gives the error message:
"report -----.rpt could not be submited for background processing"
I am using crystal 8.5, vb.net and sQl server.
Any idea?
thanks in advance
anurc