• Miércoles 24 de Abril de 2024, 06:07

Autor Tema:  Crystal Reports Con Condicion  (Leído 1721 veces)

Daniel "The Crow&quo

  • Nuevo Miembro
  • *
  • Mensajes: 1
    • Ver Perfil
Crystal Reports Con Condicion
« en: Jueves 1 de Julio de 2004, 02:50 »
0
hola a todos
tengo que presentar un proyecto. en mi base de datos hay un campo "Curso" otro "Paralelo" y "especialidad".

necesito que cuando se cumpla una condicion como por ejemplo curso= 'sexto'  Paralelo='a'  y Especialidad= 'informatica' el reporte me imprima los registros que cumplan esa condicion, por favor ayudenme!!!!!! es de urgencia...

Juan C

  • Miembro activo
  • **
  • Mensajes: 50
    • Ver Perfil
Re: Crystal Reports Con Condicion
« Respuesta #1 en: Viernes 9 de Julio de 2004, 02:18 »
0
Daniel:

' LO QUE PONGO ASI´: {PICKING.PICREGISTRADO} EN ESTE EJEMPLO PICKING ES LA TABLA Y PIC REGISTRDAO ES EL CAMPO

folio = Mid(cmbArtdel.Text, 1, 3)
folio2 = Mid(cmbArtAl.Text, 1, 3)
Ubi = "S"
strUbicada = "{PICKING.PICREGISTRADO}=" & "'" & Ubi & "'"

'con 2 variables de clientes CUANDO TIENES QUE ELEGIR DE UN COMBOBOX
strfolio = "{PICKING.PICCLICLAVE}>= " & "'" & folio & "'" & " AND {PICKING.PICCLICLAVE}<= " & "'" & folio2 & "'"

' CUANDO USES FECHAS
dia = Day(Dtpfechaini.Value)
mes = Month(Dtpfechaini.Value)
año = Year(Dtpfechaini.Value)
fechainicial = "#" & mes & "/" & dia & "/" & año & "#"
dia = Day(DTPfechafin.Value)
mes = Month(DTPfechafin.Value)
año = Year(DTPfechafin.Value)
fechafinal = "#" & mes & "/" & dia & "/" & año & "#"
varfechaalta = "{PICKING.PICFECHA}>= " & fechainicial & " And {PICKING.PICFECHA}<= " & fechafinal

Screen.MousePointer = vbHourglass
CReport1.DataFiles(0) = gblubicacionbase ' ES UNA VARIABLE DONDE ESTA LA BASE DE DATOS
' PODRIAS PONER EJEMPLO:
'CReport1.DataFiles(0) = "c:\carpeta\base.mdb"

CReport1.Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & gblubicacionbase & ";Persist Security Info=False "
CReport1.ReportSource = crptReport

'AQUI JUNTO LAS CONDICIONES DE LAS TRES EN UNA SOLA FORMULA
formu = "(" & strfolio & ")" & " " & "AND" & " " & "(" & strUbicada & ")" & " " & "AND" & " " & "(" & varfechaalta & ")"

CReport1.SelectionFormula = formu
CReport1.ReportFileName = App.Path & "\reportes\SalidasDetalladoR11.rpt"
CReport1.Action = 1


pruebalo seguramente te funcionara y de aqui en adelante con tu imaginación puedes lograr lo que quieras.
a mi me funciona

Saludos

Juan Carlos