CR 9, Access. Conraseña
Publicado por Francisco Rivas (371 intervenciones) el 21/12/2006 17:32:01
Esto me lo encontré
----------------------------------------------
Estimados por fin pude saber como utilizar el CR9 con Access con contraseña
para quienes estén en el mismo dilema entrego los códigos
Primero se crea el reporte en el CR luego se agrega un en componentes el
Crystal report viewer 9 y en referencias se agrega la referencia de runtime
crystal 9
en el proyecto creas un formulario y pones el controlo CR y el siguiente
código
Dim Cra As CRAXDRT.Application
Dim Crp As CRAXDRT.Report
Dim CnnP As CRAXDRT.ConnectionProperty
Dim Tbl As CRAXDRT.DatabaseTable
Dim Dbs1 As CRAXDRT.Database
Dim str As String
Private Sub Form_Load()
Dim rs As New ADODB.Recordset
Set Cra = New CRAXDRT.Application
Set Crp = Cra.OpenReport("la ruta donde esta el archivo, 1)
Dim i As Long
Crp.DiscardSavedData
'Declare a Connection Info Object
Dim ConnectionInfo As CRAXDRT.ConnectionProperties
Set ConnectionInfo = Crp.Database.Tables(1).ConnectionProperties
ConnectionInfo.Item("Database Name") = "donde esta ubicada la base"
ConnectionInfo.Item("Database Password") = "se pone la pasword de la
base"
ConnectionInfo.Item("Session UserID") = ""
ConnectionInfo.Item("Session Password") = ""
Crp.RecordSelectionFormula = " se pone la formual para filtrar registros
en el caso necesari"
CRViewer91.ReportSource = Crp 'asignar el objeto reporte al control vista de
reportes
CRViewer91.ViewReport 'ver el reporte
Screen.MousePointer = 0
End Sub
Private Sub Form_Resize()
CRViewer91.Top = 0
CRViewer91.Left = 0
CRViewer91.Height = ScaleHeight
CRViewer91.Width = ScaleWidth
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set Crp = Nothing
Set Cra = Nothing
End Sub
Espero que le sea util
----------------------------------------------
Estimados por fin pude saber como utilizar el CR9 con Access con contraseña
para quienes estén en el mismo dilema entrego los códigos
Primero se crea el reporte en el CR luego se agrega un en componentes el
Crystal report viewer 9 y en referencias se agrega la referencia de runtime
crystal 9
en el proyecto creas un formulario y pones el controlo CR y el siguiente
código
Dim Cra As CRAXDRT.Application
Dim Crp As CRAXDRT.Report
Dim CnnP As CRAXDRT.ConnectionProperty
Dim Tbl As CRAXDRT.DatabaseTable
Dim Dbs1 As CRAXDRT.Database
Dim str As String
Private Sub Form_Load()
Dim rs As New ADODB.Recordset
Set Cra = New CRAXDRT.Application
Set Crp = Cra.OpenReport("la ruta donde esta el archivo, 1)
Dim i As Long
Crp.DiscardSavedData
'Declare a Connection Info Object
Dim ConnectionInfo As CRAXDRT.ConnectionProperties
Set ConnectionInfo = Crp.Database.Tables(1).ConnectionProperties
ConnectionInfo.Item("Database Name") = "donde esta ubicada la base"
ConnectionInfo.Item("Database Password") = "se pone la pasword de la
base"
ConnectionInfo.Item("Session UserID") = ""
ConnectionInfo.Item("Session Password") = ""
Crp.RecordSelectionFormula = " se pone la formual para filtrar registros
en el caso necesari"
CRViewer91.ReportSource = Crp 'asignar el objeto reporte al control vista de
reportes
CRViewer91.ViewReport 'ver el reporte
Screen.MousePointer = 0
End Sub
Private Sub Form_Resize()
CRViewer91.Top = 0
CRViewer91.Left = 0
CRViewer91.Height = ScaleHeight
CRViewer91.Width = ScaleWidth
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set Crp = Nothing
Set Cra = Nothing
End Sub
Espero que le sea util
Valora esta pregunta
0