Page 1 of 1

Un viejo problema con TReport (SOLUCIONADO)

PostPosted: Mon Mar 01, 2010 4:19 pm
by Armando
Amigos, y en especial a A. Linares & team:

En las versiones de FW a 16 bits un reporte creado con la clase TReport se mostraba así:

Image

Observen los textos ENTRADAS SALIDAS SALDOS, ocupan dos o hasta tres columnas simulando unos super header y esto es lo correcto.

Sin embargo ahora con las versiones a 32bits se muestra así:

Image

Los mismos textos se recortan a una sola columna.

El código es el mismo para ambos reportes solo cambia la version de 16 a 32bits

Code: Select all  Expand view

COLUMN TITLE "","Fecha"                 DATA Date2Txt((cVales)->DET_FEC) SIZE 10 RIGHT
COLUMN TITLE "","Referencia"            DATA (cVales)->DET_REF SIZE 10 LEFT
COLUMN TITLE "","Vale"                  DATA (cVales)->DET_VAL SIZE  5 RIGHT
COLUMN TITLE "Costo","Unitario"     DATA (cVales)->DET_UNI SIZE 10 RIGHT PICTURE "@Z 99,999,999.99"
COLUMN TITLE "","Cntdd"                 DATA IF ((cVales)->DET_EOS == 1,(cVales)->DET_CTD,0) SIZE  7 RIGHT PICTURE "@Z 999,999" TOTAL
COLUMN TITLE "E   N   T   R   A   D   A   S ",;
        "Importe"               DATA IF ((cVales)->DET_EOS == 1,(cVales)->DET_NET,0) SIZE 12 RIGHT PICTURE "@Z 99,999,999.99" TOTAL
COLUMN TITLE "","Undd"                  DATA (cVales)->DET_NUM SIZE  5 RIGHT
COLUMN TITLE "","Cntdd"                 DATA IF ((cVales)->DET_EOS == 2,(cVales)->DET_CTD,0) SIZE  7 RIGHT PICTURE "@Z 99,999" TOTAL
COLUMN TITLE "S      A      L      I      D      A      S  ",;
        "Importe"               DATA IF ((cVales)->DET_EOS == 2,(cVales)->DET_NET,0) SIZE 12 RIGHT PICTURE "@Z 99,999,999.99" TOTAL
COLUMN TITLE "","Cntdd"                 DATA "" SIZE  5 RIGHT TOTAL PICTURE "@ 999,999"
COLUMN TITLE "S    A    L    D    O    S  ",;
        "Importe"               DATA "" SIZE 12 RIGHT TOTAL PICTURE "@ 999,999,999.99"
 


Cómo puedo lograr el mismo efecto que aparece en 16bits pero ahora en 32 ?.

Antonio, sería excelente que esta clase tuviera la posibilidad de los Super Headers como en la clase TXBrowse.

Desafortunadamente mis conocimientos no alcanzan para modificar la clase.

Agradecido con su apoyo.

Saludos

Re: Un viejo problema con TReport

PostPosted: Tue Mar 02, 2010 11:43 am
by Armando
Maestro Antonio:

Será que no hay solución a esto ?

Saludos

Re: Un viejo problema con TReport

PostPosted: Wed Mar 03, 2010 1:24 am
by Armando
Antonio:

Disculpa la insistencia pero ya tengo convertida toda la aplicación y solo este problema me esta retrasando la entrega a mi cliente.

Ojalá pudiera haber alguna solución.

Saludos

Re: Un viejo problema con TReport

PostPosted: Wed Mar 03, 2010 4:12 am
by Daniel Garcia-Gil
Armando

Prueba con cambiar el METHOD SayTitle de la clase TRColumn por este otro, luego nos comentas, gracias

Code: Select all  Expand view

METHOD SayTitle(nRow, nCol, nLine)  CLASS TRColumn

     LOCAL oFont
     LOCAL cTitle
     LOCAL nWidth, nFont
     LOCAL nTxtWidth

     DEFAULT nRow  := 0      ,;
             nCol  := ::nCol ,;
             nLine := 1

     IF nLine > len(::aTitle)
          RETU NIL
     ENDIF

     cTitle := eval(::aTitle[nLine])
     nFont  := eval(::bTitleFont)
     oFont  := ::oReport:aFont[nFont]

     ::nCurLine := nLine

     nTxtWidth = ::oReport:oDevice:GetTextWidth(cTitle, ::oReport:aFont[eval(::bDataFont)] )

     IF ::nWidth < nTxtWidth
        ::oReport:oDevice:Say(nRow, nCol - ( nTxtWidth - ::nWidth ), cTitle, oFont, nTxtWidth,;
                           ::oReport:aClrText[nFont],,::nPad-1)
     ELSE
        ::oReport:oDevice:Say(nRow, nCol, cTitle, oFont, ::nWidth,;
                           ::oReport:aClrText[nFont],,::nPad-1)
     ENDIF
                           

RETURN NIL
 

Re: Un viejo problema con TReport

PostPosted: Wed Mar 03, 2010 3:41 pm
by Armando
Daniel:

Para variar :D , éxito total (como siempre).

Muchas gracias

Saludos