AYUDA CON LA CONECCI贸N CRYSTAL REPORT
Private Sub Form_Load()
Set Cr = CreateObject("Crystal.CrystalReport")
End Sub
Private Sub ReporteB_Click(Index As Integer)
Dim Fecha As String, F As Date, CC As CrystalReport
Select Case Index
Case 0
Fecha = InputBox("Por favor suministre la fecha del informe", "Informe diario", Format(Now, "dd/mm/yyyy"))
If Fecha = "" Then Exit Sub
If Not IsDate(Fecha) Then
MsgBox "Dato de fecha no v谩lido", vbExclamation, "Atenci贸n"
Exit Sub
End If
With Cr
.Reset
.Connect = "provider= Microsoft.jet.oledb.4.0.; data source= Hotel;pwd= salvadorcastillo"
.WindowTitle = "Reporte de Registro del Hotel"
.WindowState = crptMaximized
.WindowShowPrintBtn = True
.ReportFileName = App.Path & "Registro.rpt"
.SelectionFormula = "{historial.fentrada}=#" & Format(CDate(Fecha), "dd/mm/yyyy") & "#"
.Formulas(0) = "empresa='" & NombreDeLaEmpresa & "'"
.Formulas(1) = "per铆odo='Correspondiente al d铆a " & Fecha & "'"
.Action = 0
End With
Set Cr = CreateObject("Crystal.CrystalReport")
End Sub
Private Sub ReporteB_Click(Index As Integer)
Dim Fecha As String, F As Date, CC As CrystalReport
Select Case Index
Case 0
Fecha = InputBox("Por favor suministre la fecha del informe", "Informe diario", Format(Now, "dd/mm/yyyy"))
If Fecha = "" Then Exit Sub
If Not IsDate(Fecha) Then
MsgBox "Dato de fecha no v谩lido", vbExclamation, "Atenci贸n"
Exit Sub
End If
With Cr
.Reset
.Connect = "provider= Microsoft.jet.oledb.4.0.; data source= Hotel;pwd= salvadorcastillo"
.WindowTitle = "Reporte de Registro del Hotel"
.WindowState = crptMaximized
.WindowShowPrintBtn = True
.ReportFileName = App.Path & "Registro.rpt"
.SelectionFormula = "{historial.fentrada}=#" & Format(CDate(Fecha), "dd/mm/yyyy") & "#"
.Formulas(0) = "empresa='" & NombreDeLaEmpresa & "'"
.Formulas(1) = "per铆odo='Correspondiente al d铆a " & Fecha & "'"
.Action = 0
End With
