FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Cambiar Color Item en Easy Report
Posts: 1816
Joined: Wed Oct 26, 2005 02:49 PM
Cambiar Color Item en Easy Report
Posted: Thu May 12, 2011 07:53 PM
Amigos del foro buen dia.

Lo que necesito es cambiar el color de un item de acuerdo con una codicion que tengo en la base de datos. Por ejemplo si es negativo que se cambie el color a rojo y que si es Mayor de 100.000 se ponga en negrilla. Busque en el foro pero no encuentro la respuesta. Mire los ejemplos de tengo de Easy pero logro hacer que funcione el codigo que tengo es el siguiente:

Code (fw): Select all Collapse
   DO WHILE .NOT. EOF()

      //Change item color
      oItem := VRDItem():New( NIL, oVRD, 3, 106)
      nOldCol        := oItem:nColFill
      oItem:nColFill := 1
      oItem:Set()

      PRINTAREA 3 OF oVRD ;
         ITEMIDS    { 104, 105, 106, 107 } ;
         ITEMVALUES { EXAMPLE->UNIT                               , ;
                      ALLTRIM(STR( EXAMPLE->PRICE, 10, 2 ))       , ;
                      ALLTRIM(STR( EXAMPLE->TOTALPRICE, 11, 2 ))  , ;
                      ALLTRIM( ".\EXAMPLES\" + EXAMPLE->IMAGE ) }

      //Set old item color
      oItem:nColFill := nOldCol
      oItem:Set()

      EXAMPLE->(DBSKIP())
      lLastPosition := EXAMPLE->(EOF())
      EXAMPLE->(DBSKIP(-1))

      nTotal += EXAMPLE->TOTALPRICE

      //New Page
      if lLastPosition = .T. .AND. oVRD:nNextRow > oVRD:nPageBreak - oVRD:aAreaHeight[4] .OR. ;
         lLastPosition = .F. .AND. oVRD:nNextRow > oVRD:nPageBreak

         //Print order footer
         PRINTAREA 5 OF oVRD ;
            ITEMIDS    { 101, 102 } ;
            ITEMVALUES { cCompany, ;
                         MEMOREAD( ".\examples\EasyReportExample.txt" ) }

         PAGEBREAK oVRD

         //Print position header
         PRINTAREA 2 OF oVRD

      ENDIF

      EXAMPLE->(DBSKIP())

   ENDDO


De antemano gracias
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]
Posts: 1816
Joined: Wed Oct 26, 2005 02:49 PM
Re: Cambiar Color Item en Easy Report SOLUCIONADO
Posted: Thu May 12, 2011 08:33 PM
Por si algun dia alquien tiene la misma pregunta TONTA jajaja. Me faltaba definir el color en el Reporte. quedo así

Code (fw): Select all Collapse
   oItem          := LVRDItem():New( NIL, oVRD, 1, 102 )
   nOldCol        := oItem:nColText
   oItem:nColText := 3
   oItem:Set()

  PRINTAREA 1 OF oVRD;
  ITEMIDS    {101,102,103,104,106,107,105};
  ITEMVALUES {alltrim(oLamcla:vGnom),"NIT: "+alltrim(oLamcla:vGnit),uFec,alltrim(uTim),vTRep,vTDes,Transform(Pagina,"999,999")}

   //Set old item color
   oItem:nColText := nOldCol
   oItem:Set()


:-)
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]
Posts: 1816
Joined: Wed Oct 26, 2005 02:49 PM
Re: Cambiar Color Item en Easy Report (SOLUCIONADO)
Posted: Sun Oct 11, 2020 01:58 AM
Buenas noches para todos

Por si algun dia alquien tiene la misma pregunta. Me faltaba definir el color en el Reporte. quedo así

Code (fw): Select all Collapse
   oItem          := LVRDItem():New( NIL, oVRD, 1, 102 )
   nOldCol        := oItem:nColText
   oItem:nColText := 3
   oItem:Set()

  PRINTAREA 1 OF oVRD;
  ITEMIDS    {101,102,103,104,106,107,105};
  ITEMVALUES {alltrim(oLamcla:vGnom),"NIT: "+alltrim(oLamcla:vGnit),uFec,alltrim(uTim),vTRep,vTDes,Transform(Pagina,"999,999")}

   //Set old item color
   oItem:nColText := nOldCol
   oItem:Set()





Con las versiones anteriores de FW, este código me funcionaba. Lograba cambiar el color de un ítem en tiempo de ejecución. Con las nuevas versiones de FW, me devuelve el error, no existe método LVRDItem, estuve revisando la clase y efectivamente no existe. Intente de la siguiente manera, pero no funciona, ¿Qué me hace falta?

Code (fw): Select all Collapse
                aIdRep := { 201 , 205 }
                aIdVal := { if(nCnAd=1,alltrim(oRsPr:Fields( "titulo" ):Value ),""),;
                             alltrim(oRsPr:Fields( "valor" ):Value);
                            }

                oVRD:AreaStart( 2 , .T. , aIdRep , aIdVal)
                oItem := oVRD:GetItem( 2, 205 )
                oItem:nColtext := 3
                oVRD:PrintArea( 2 )
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]

Continue the discussion