Hi, every body...
I've got a problem. I'm making a report (in Crystal Reports 8..5). This reports executes a Store Procedure. I have an application in
VB 2005 from where I send the parameters to the report. One of these parameters is the one I need to execute the store procedure in the report but, when I send the parameters, all of them are shown in the report but the one of the SP doesn't take the value. I have no errors in the
VB code. It just does not show any data because this parameter doesn't take any value.
Here's the part of my code.
Dim myReport As New ReportDocument
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
Dim mySubRepDoc As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent
myReport.Load(Application.StartupPath & "\reportes\CONTROL_ACCESOS_X_SISTEMA.rpt")
Dim crParameterDiscreteValue As ParameterDiscreteValue
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldLocation As ParameterFieldDefinition
Dim crParameterValues As ParameterValues
crParameterFieldDefinitions = myReport.DataDefinition.ParameterFields
' Here I set the values to the parameters of the report.
crParameterFieldLocation = crParameterFieldDefinitions.Item("@sistema") 'This is the Store Procedure parameter
crParameterValues = crParameterFieldLocation.CurrentValues
crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
crParameterDiscreteValue.Value = sistemaID
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldLocation.ApplyCurrentValues(crPara meterValues)
crParameterFieldLocation = crParameterFieldDefinitions.Item("dcsidName")
crParameterValues = crParameterFieldLocation.CurrentValues
crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
crParameterDiscreteValue.Value = generatorName
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldLocation.ApplyCurrentValues(crPara meterValues)
' Here I send the parameters in order to get the connection
For Each tbCurrent In myReport.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = System.Configuration.ConfigurationManager.AppSetti ngs.Item("sqlServerProd")
.UserID = System.Configuration.ConfigurationManager.AppSetti ngs.Item("sqlUserProd")
.Password = decript.desencripta(System.Configuration.Configura tionManager.AppSettings.Item("sqlPassProd"))
.DatabaseName = System.Configuration.ConfigurationManager.AppSetti ngs.Item("sqlCatalog")
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
Me.CrystalReportViewer1.ReportSource = Nothing
Me.CrystalReportViewer1.ReportSource = myReport
CrystalReportViewer1.Show()
Could you pls help me? I'm getting desperated.
See you
---------------------
Thanks to everyone