Retroceder   Foros del Web > Programación para sitios web > .NET

Respuesta
 
Herramientas Desplegado
Antiguo 13-feb-2007, 14:25   #1 (permalink)
vecasita ha deshabilitado el karma
 
Avatar de vecasita
 
Fecha de Ingreso: abril-2006
Mensajes: 71
Triste Crystal. Parametros en Subreportes cambiando la BD

Hola a todos tengo el siguiente problema con crystal.
Tengo un reporte que tiene un subreporte que anda de lo mas bien hasta cuando lo levanto apuntando a otra base de datos(Distinta a la que use cuando cree el reporte) porque entonces me pide por pantalla los parametros del subreporte.[ahh, por si acaso si estoy vinculado los parametros del reporte con el subreporte]

Alguien sabe porque no funciona el paso de los parametros?

estoy pasando de esta forma los parametros y la conexion:

Reporte.SetParameterValue("@id_proceso_carga", Id_Proceso_Carga)
Reporte.SetParameterValue("@Id_Perfil", Id_Perfil)
Reporte.SetParameterValue("@id_cuenta", Id_Cuenta)

' CAMBIA LA CONEXION DE LA BASE DE DATOS
Dim crTables As CrystalDecisions.CrystalReports.Engine.Tables
Dim crTable As CrystalDecisions.CrystalReports.Engine.Table
Dim crConnInfo As New CrystalDecisions.Shared.ConnectionInfo
Dim crLogOnInfo As CrystalDecisions.Shared.TableLogOnInfo

crTables = Reporte.Database.Tables

For Each crTable In crTables
crConnInfo.DatabaseName = rptnombd
crConnInfo.ServerName = rptservidor
crConnInfo.UserID = rptlogin
crConnInfo.Password = rptpassword
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crConnInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
crTable.Location = rptnombd & ".dbo." & crTable.Location.Substring(crTable.Location.LastIn dexOf(".") + 1)
crTable.TestConnectivity()
Next

CAll subreportes()

CRV_Reporte.ReuseParameterValuesOnRefresh = True
CRV_Reporte.ReportSource = Reporte_Calculo_Dispersion
CRV_Reporte.RefreshReport()



donde subreportes es:

Sub SubReportes()
Dim ci As ConnectionInfo
ci = New ConnectionInfo()
Dim Obj_SubReporte As SubreportObject
Dim SubReporte As New ReportDocument

ci.ServerName = rptservidor
ci.DatabaseName = rptnombd
ci.UserID = rptlogin
ci.Password = rptpassword

Dim Obj_Reporte As ReportObject
For Each Obj_Reporte In Reporte.ReportDefinition.ReportObjects
If Obj_Reporte.Kind = ReportObjectKind.SubreportObject Then
Obj_SubReporte = CType(Obj_Reporte, SubreportObject)
SubReporte = Obj_SubReporte.OpenSubreport(Obj_SubReporte.Subrep ortName)
Conexion_SubReporte(SubReporte)
End If
Next

End Sub

y Conexion_SubReporte(SubReporte) es:
Sub Conexion_SubReporte(ByVal SubReporte As ReportDocument)

' CAMBIA LA CONEXION DE LA BASE DE DATOS
Dim crTables As CrystalDecisions.CrystalReports.Engine.Tables
Dim crTable As CrystalDecisions.CrystalReports.Engine.Table
Dim crConnInfo As New CrystalDecisions.Shared.ConnectionInfo
Dim crLogOnInfo As CrystalDecisions.Shared.TableLogOnInfo

crTables = SubReporte.Database.Tables

For Each crTable In crTables
crConnInfo.DatabaseName = rptnombd
crConnInfo.ServerName = rptservidor
crConnInfo.UserID = rptlogin
crConnInfo.Password = rptpassword
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crConnInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
crTable.Location = rptnombd & ".dbo." & crTable.Location.Substring(crTable.Location.LastIn dexOf(".") + 1)
crTable.TestConnectivity()
Next

End Sub



alguna idea ?
me falta definir los parametros para el subreporte ? pero entonces porq funciona cuando la BD coincide con la BD usada para crear el reporte ?

por favor...cualquier idea es bienvenida
de antemano muchas gracias
vecasita está desconectado   Responder Citando
Respuesta

No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 08:57.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93