Cambiar BDD en informe de Crystal Reports

23/08/2004 - 11:31 por Juanjo | Informe spam
Hola,
¿Cómo puedo cambiar el servidor y la BDD a la que apunta un informe de
CR? Porque en los clientes donde instalo el programa, no tienen un servidor
ni BDD con nombre igual al mío.

Por cierto, buscando en anteriores mensajes he encontrado respuestas
para solucionarlo mediante el código que pongo más abajo, pero a mí no me ha
funcionado.

¿Deberé crearme un DataSet que alimente cada informe? Si es así, menuda
chapuza..

Saludos, Juanjo.


'Creo una instancia a mi Reporte "Curriculum"
Dim crReportDocument As New Curriculum()
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo

'Create an instance of the strongly-typed report object
crReportDocument = New Curriculum()

'Setup the connection information structure to be used()
'to log onto the datasource for the report.
crConnectionInfo = New ConnectionInfo()
With crConnectionInfo
.ServerName = "ElServidor"
.DatabaseName = "LaBasedeDatos"
.UserID = "ElUsuario"
.Password = "LaClave"
End With

'Get the table information from the report
crDatabase = crReportDocument.Database
crTables = crDatabase.Tables

'Loop through all tables in the report and apply the(connection)
'information for each table.
For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next


'Set the viewer to the report object to be previewed.

CrystalReportViewer1.ReportSource = crReportDocument
 

Leer las respuestas

#1 Freddy Cáceres
23/08/2004 - 15:09 | Informe spam
que tal juanjo:

Cuentanos, contra que base de datos y que vercion de crystal.

tb aca he publicados algunos tips de crystal
http://www.tips.cl/sitio/modulos/sitio/?idcat2

Saludos
-
Freddy Cáceres
Santiago - Chile

Hola,
¿Cómo puedo cambiar el servidor y la BDD a la que


apunta un informe de
CR? Porque en los clientes donde instalo el programa, no


tienen un servidor
ni BDD con nombre igual al mío.

Por cierto, buscando en anteriores mensajes he


encontrado respuestas
para solucionarlo mediante el código que pongo más abajo,


pero a mí no me ha
funcionado.

¿Deberé crearme un DataSet que alimente cada informe?


Si es así, menuda
chapuza..

Saludos, Juanjo.


'Creo una instancia a mi Reporte "Curriculum"
Dim crReportDocument As New Curriculum()
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo

'Create an instance of the strongly-typed report object
crReportDocument = New Curriculum()

'Setup the connection information structure to be used()
'to log onto the datasource for the report.
crConnectionInfo = New ConnectionInfo()
With crConnectionInfo
.ServerName = "ElServidor"
.DatabaseName = "LaBasedeDatos"
.UserID = "ElUsuario"
.Password = "LaClave"
End With

'Get the table information from the report
crDatabase = crReportDocument.Database
crTables = crDatabase.Tables

'Loop through all tables in the report and apply


the(connection)
'information for each table.
For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next


'Set the viewer to the report object to be previewed.

CrystalReportViewer1.ReportSource = crReportDocument


.

Preguntas similares