Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Impresión
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 18-08-2008
Avatar de richy08
richy08 richy08 is offline
Miembro
 
Registrado: may 2007
Ubicación: Bucerias, Nayarit Mexico
Posts: 529
Poder: 17
richy08 Va por buen camino
Crear Parametros dinamicamente en Crystal desde delphi

Buenos dias Compañeros tengo un pequeño problema cree un reporte el cual a veces necesito que filtre por tres campos y a veces por dos el detalle es como puede indicarle a crystal que cree en el reporte lso parametros la formula las borro y las vuelvo a genrar el problema es crear los parametros gracias por cualquioer ayuda.

Código Delphi [-]
  Crp_OcuRat.WindowState:=WsMaximized;
      Crp_OcuRat.Selection.Formula.Clear;
      if dbl_Age.KeyValue=Null then
      begin
         Crp_OcuRat.Selection.Formula.Add(' {reserve.sStaRes}=''PA'' and {reserve.dArrivaldate}>={?fecini} and {reserve.dArrivaldate}<={?fecend}');
         Crp_OcuRat.Paramfields[0].currentvalue:=FormatDateTime(' yyyy,mm,dd',Dtp_ArrDat.date);
         Crp_OcuRat.Paramfields[1].currentvalue:=FormatDateTime(' yyyy,mm,dd',dtp_deda.date);
      end
      else
      begin
         Crp_OcuRat.Selection.Formula.Add(' {reserve.sStaRes}=''PA'' and {reserve.dArrivaldate}>={?fecini} and {reserve.dArrivaldate}<={?fecend} and {sources.sSourceCode}={?agencie}');
         Crp_OcuRat.Paramfields[0].currentvalue:=FormatDateTime(' yyyy,mm,dd',Dtp_ArrDat.date);
         Crp_OcuRat.Paramfields[1].currentvalue:=FormatDateTime(' yyyy,mm,dd',dtp_deda.date);
         Crp_OcuRat.Paramfields[2].currentvalue:=dbl_age.KeyValue;
      end;
        Crp_OcuRat.Show;
Responder Con Cita
  #2  
Antiguo 18-08-2008
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 25
Caral Va por buen camino
Hola
Seguro me equivoco, pero:

Código Delphi [-]
Crp_OcuRat.WindowState:=WsMaximized;
      Crp_OcuRat.Selection.Formula.Clear;
      if dbl_Age.KeyValue=Null then
      begin
         Crp_OcuRat.Selection.Formula.Add('reserve.sStaRes =''PA'' and reserve.dArrivaldate >= :?fecini and reserve.dArrivaldate <= :?fecend');
         Crp_OcuRat.Paramfields[0].currentvalue:=FormatDateTime(' yyyy,mm,dd',Dtp_ArrDat.date);
         Crp_OcuRat.Paramfields[1].currentvalue:=FormatDateTime(' yyyy,mm,dd',dtp_deda.date);
      end
      else
      begin
         Crp_OcuRat.Selection.Formula.Add('reserve.sStaRes =''PA'' and reserve.dArrivaldate >= :?fecini and reserve.dArrivaldate <= :?fecend and sources.sSourceCode = :?agencie');
         Crp_OcuRat.Paramfields[0].currentvalue:=FormatDateTime(' yyyy,mm,dd',Dtp_ArrDat.date);
         Crp_OcuRat.Paramfields[1].currentvalue:=FormatDateTime(' yyyy,mm,dd',dtp_deda.date);
         Crp_OcuRat.Paramfields[2].currentvalue:=dbl_age.KeyValue;
      end;
        Crp_OcuRat.Show;
Desconozco por que el uso del signo de interrogarion en los parametros., si el campo se llama asi, pues estará bien.
Me da la impresion de que usas Access, me equivoco?.
Saludos
__________________
Siempre Novato
Responder Con Cita
  #3  
Antiguo 18-08-2008
Avatar de richy08
richy08 richy08 is offline
Miembro
 
Registrado: may 2007
Ubicación: Bucerias, Nayarit Mexico
Posts: 529
Poder: 17
richy08 Va por buen camino
Hola gracias caral por contestarme pero no para nada ni loco utilizaria access utilizo mssql2005 y pues ya encontre la solucion jeje la posteo

Código Delphi [-]
 Crp_OcuRat.Selection.Formula.Clear;
      if dbl_Age.KeyValue=Null then
      begin
         Crp_OcuRat.Selection.Formula.Add(' {reserve.sStaRes}=''PA'' and {reserve.dArrivaldate}>={?fecini} and {reserve.dArrivaldate}<={?fecend}');

      end
      else
      begin
         Crp_OcuRat.Selection.Formula.Add(' {reserve.sStaRes}=''PA'' and {reserve.dArrivaldate}>={?fecini} and {reserve.dArrivaldate}<={?fecend} and {sources.sSourceCode}='+''''+Dbl_Age.KeyValue+'''');
      end;
        Crp_OcuRat.Paramfields[0].currentvalue:=FormatDateTime(' yyyy,mm,dd',Dtp_ArrDat.date);
        Crp_OcuRat.Paramfields[1].currentvalue:=FormatDateTime(' yyyy,mm,dd',dtp_deda.date);
        Crp_OcuRat.Show;
Responder Con Cita
  #4  
Antiguo 04-09-2008
Avatar de richy08
richy08 richy08 is offline
Miembro
 
Registrado: may 2007
Ubicación: Bucerias, Nayarit Mexico
Posts: 529
Poder: 17
richy08 Va por buen camino
Cita:
Empezado por lasersguru Ver Mensaje
Your post rocks!
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Crear ODBC dinámicamente? HccSoft Conexión con bases de datos 3 18-03-2008 15:19:32
Agrupar dinamicamente con Crystal Reports Hefestos Impresión 1 09-03-2007 09:24:30
como guardar pdf desde Crystal 8.0 con delphi alexander66 Impresión 1 15-12-2006 18:17:18
Vincular tablas dbf en msaccess dinámicamente desde delphi SLAKE Conexión con bases de datos 0 06-10-2004 18:22:16
crear popups dinamicamente. tango01 OOP 2 06-01-2004 16:33:03


La franja horaria es GMT +2. Ahora son las 02:11:50.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi