Reporte en Crystal

21/10/2004 - 18:43 por Damian | Informe spam
Miren el problema es el siguiente
Tengo un Reporte al Cual inserte un subreporte
como seteo los parametros de coneccion del subreporte
alguien puede Ayudarme?
A continuacion esto funciona bien sin el subreporte pero el momento de
incluirlo no funciona

Dim pvCollection As New CrystalDecisions.Shared.ParameterValues
Dim pdvEmpresa As New CrystalDecisions.Shared.ParameterDiscreteValue
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
Dim rptClientes As New ReportDocument
Try
rptClientes.Load("Cliente.Rpt")

For Each tbCurrent In rptClientes.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = sServer
.UserID = sUsuario
.Password = sPassword
.DatabaseName = sBase
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent

pdvEmpresa.Value = sCodEmpresa

pvCollection.Add(pdvEmpresa)

rptClientes.DataDefinition.ParameterFields("@Empresa").ApplyCurrentValues(pvCollection)

el resto pero no se olviden del subreporte?
 

Leer las respuestas

#1 Henry.Net
21/10/2004 - 20:54 | Informe spam
Tu subreporte lo tienes que asignar una nueva variable report

ejemplo

Dim subReport As CRAXDRT.Report
Dim SubRep As SubreportObject
Dim Sect As Section
Dim rptO As Object

For Each Sect In CReport.Sections 'Buscas en las selecciones del reporte
For Each rptO In Sect.ReportObjects
If rptO.Kind = crSubreportObject Then 'Si la seleccion es un
subreporte lo asignas a la report
SubRep = rptO
subReport = CReport.OpenSubreport(SubRep.SubreportName)
Exit For
End If
Next
Next

en donde CReport es del tipo ReportDocument

Saludos

Esto esta en Cristal 8.0, CR 9.0 ha de ser algo parecido saludos


"Damian" escribió en el mensaje
news:
Miren el problema es el siguiente
Tengo un Reporte al Cual inserte un subreporte
como seteo los parametros de coneccion del subreporte
alguien puede Ayudarme?
A continuacion esto funciona bien sin el subreporte pero el momento de
incluirlo no funciona

Dim pvCollection As New CrystalDecisions.Shared.ParameterValues
Dim pdvEmpresa As New CrystalDecisions.Shared.ParameterDiscreteValue
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
Dim rptClientes As New ReportDocument
Try
rptClientes.Load("Cliente.Rpt")

For Each tbCurrent In rptClientes.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = sServer
.UserID = sUsuario
.Password = sPassword
.DatabaseName = sBase
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent

pdvEmpresa.Value = sCodEmpresa

pvCollection.Add(pdvEmpresa)

rptClientes.DataDefinition.ParameterFields("@Empresa").ApplyCurrentValues(pvCollection)

el resto pero no se olviden del subreporte?

Preguntas similares