RE:Flexgrid + Crystal Report
AL REPORTE TU LE PUEDES MARDAR DATOS A TRAVES DE FORMULAS COMO DE QUERYS ACA TE MANDO UN EJEMPLO EN SQL
ESTA ES LA CONEXION EN VISUAL
Private Sub Definir_Conexion()
Private Sub Definir_Conexion()
CrystalReport1.Connect = "UID=" + Gl_Usuario + ";PWD=" + Gl_Pass + ";Data Source=" + GL_Base_BD
CrystalReport1.ReportFileName = Gl_Reportes + "PV_L13.rpt"
End Sub
LUEGO EN EL CRUSYAL DEBES CREAR EL RPT Y DECIRLE QUE VAS A USAR UN PROVEEDOR DE DATOS SQL AHI TE CONECTAS A LA BASE Y AGREGAS LAS TABLAS QUE NECESITAS
LUEGO EN EL VISUAL LE PASAS EL QUERY
Private Sub bo_editar_Click()
On Error GoTo ERRORCONEXION
MousePointer = 11
pasar_parametros
If Sw_datos Then
CrystalReport1.Destination = crptToWindow
CrystalReport1.Action = 1
End If
MousePointer = Default
Exit Sub
ERRORCONEXION:
MsgBox Err.Description & " Nº de error = " & Err.Number
Exit Sub
End Sub
Private Sub pasar_parametros()
lin = 0: Mquery = " "
Mquery = "Select * From usuarios, accesos, programa where usuarios.identifi = accesos.identifi and "
Mquery = Mquery + "programa.nombrepr = accesos.nombrepr order by usuarios.identifi "
Set cmd = New Command
cmd.CommandText = Mquery
cmd.CommandType = adCmdText
Set cmd.ActiveConnection = C_Gescom
Set rsPrograma = cmd.Execute
lin = rsPrograma.RecordCount
If lin = 0 Then
MsgBox "No Se Encontrarón Datos en la Búsqueda", vbInformation, "Error en la B%F