Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/11/2004, 18:51
rojobe55
 
Fecha de Ingreso: febrero-2003
Ubicación: Costa Rica
Mensajes: 133
Antigüedad: 21 años, 3 meses
Puntos: 0
imprimir en crystal

Bueno, aqui te pongo un ejemplo que quizas no es el mejor, pero hace un poco de todo, primero seleccina un rpt segun un combo, luego arma varias formulas de selecciona, despues estas mismas entre fechas.
Para emitir el informe (action 1) y por ultimo no olvidar, poner todo a cero otra vez por si se quiere volver a imprimir. Espero que te sirma.



If combo_asiento_impresos_grupos.Text = "" Then
Report1.ReportFileName = App.Path + "\rbs-dia1.rpt"
w_texto_asiento = "asiento = ' Todos los Asientos'"
Else
Report1.ReportFileName = App.Path + "\rbs-dia1.rpt"
w_texto_asiento = "asiento = '" & combo_asiento_impresos_grupos.Text & "'"
campo5 = Chr(34) & LTrim$(combo_asiento_impresos_grupos.Text) & Chr(34) & " in {AsientosCabecera.a1_asiento}"
' Report1.SelectionFormula = "{AsientosCabecera.a1_fecha} >= " & campo3 & " and {AsientosCabecera.a1_fecha} <= " & campo4 & " and " & campo5 & " in {AsientosCabecera.a1_asiento}"
End If

Report1.Formulas(0) = "fecha_desde = '" & msk_fec_asiento(0).FormattedText & "'"
Report1.Formulas(1) = "fecha_hasta = '" & msk_fec_asiento(1).FormattedText & "'"
Report1.Formulas(2) = w_texto_asiento

Report1.SelectionFormula = ""

If msk_fec_asiento(0).Text <> "" Then
campo3 = "date(" & Format(msk_fec_asiento(0).FormattedText, "yyyy,mm,dd") & ")"
Report1.SelectionFormula = "{AsientosCabecera.a1_fecha} >= " & campo3
w_and = " and "
End If
If msk_fec_asiento(1).Text <> "" Then
campo4 = "date(" & Format(msk_fec_asiento(1).FormattedText, "yyyy,mm,dd") & ")"
Report1.SelectionFormula = Report1.SelectionFormula & w_and & "{AsientosCabecera.a1_fecha} <= " & campo4
w_and = " and "
End If

If combo_asiento_impresos_grupos.Text <> "" Then
Report1.SelectionFormula = Report1.SelectionFormula & w_and & campo5
End If

Report1.Action = 1


Report1.Formulas(0) = ""
Report1.Formulas(1) = ""
Report1.Formulas(2) = ""
Report1.SelectionFormula = ""


Saludos cordiales.