Reporte con Doble Renglon

Reporte con Doble Renglon

Postby VitalJavier » Sat Oct 10, 2020 5:56 pm

Hola, buenas tardes a Todos
Estoy tratando de hacer un Reporte (array) que depende de la longitud del nombre
pueda hacer doble renglon.

Code: Select all  Expand view

            Column Title "","Cant"                  Data aDatDetalle[nRegis,1] SIZE 8  FONT 2  Picture "9999.99"  
            Column Title "","Unid"                  Data aDatDetalle[nRegis,2] SIZE 4  FONT 2  
                       
            IF Len(AllTrim(aDatDetalle[nRegis,3])) > 35
                _ccCadena1 := AllTrim(aDatDetalle[nRegis,3])
                _ccCadena2 := ""
               ******************************** Aqui trato que el corte del Renglon sea cuando encuentro un Espacio " "
                FOR I := 35 TO 1 STEP -1
                    IF SUBSTR(_ccCadena1,I,1) = " "
                            Column Title "Nombre"               Data SubStr(aDatDetalle[nRegis,3],1,I) SIZE 35  FONT 2
                            _ccCadena2 := SubStr(aDatDetalle[nRegis,3],I+1)
                        EXIT
                    ENDIF
                NEXT               
                Imprime2Renglon(_ccCadena2,oReporte)    // Aqui imprimo en el siguiente renglon el resto de la cadena
            ELSE
                    Column Title "","Nombre"                Data aDatDetalle[nRegis,3] SIZE 35  FONT 2
            ENDIF

 


Pero no lo hace
Si alguien pudiera echarme la mano
De antemano, muchisimas gracias.
VitalJavier
 
Posts: 227
Joined: Mon Jun 10, 2013 6:40 pm

Re: Reporte con Doble Renglon

Postby karinha » Sat Oct 10, 2020 7:13 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Reporte con Doble Renglon

Postby Armando » Sat Oct 10, 2020 11:45 pm

Javier:

Creo que lo vas a tener que hacer "a pie".

Saludos
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3061
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Reporte con Doble Renglon

Postby VitalJavier » Mon Oct 12, 2020 4:27 pm

Gracias por su tiempo

Armando, pues si me la avente "a pie" y ya quedo
VitalJavier
 
Posts: 227
Joined: Mon Jun 10, 2013 6:40 pm

Re: Reporte con Doble Renglon

Postby nageswaragunupudi » Sun Nov 01, 2020 1:45 am

Report class automatically breaks long text near spaces and prints multiline text.

Code: Select all  Expand view
#include "fivewin.ch"
#include "report.ch"

function Main()

   local aData := { { "First Row",  "This is a sentence" }, ;
                    { "Second Row", "This is even a longer sentence and does not fit into one line" }, ;
                    { "ThirdRow",   "Short text" } }

   local nAt   := 1
   local oRep, oFont

   DEFINE FONT oFont NAME "ARIAL" SIZE 0,-12
   REPORT oRep PREVIEW

   COLUMN TITLE "NAME"    DATA aData[ nAt, 1 ] SIZE 15
   COLUMN TITLE "DETAILS" DATA aData[ nAt, 2 ] SIZE 30 MEMO

   oRep:bSkip  := { || nAt++ }

   ENDREPORT

   ACTIVATE REPORT oRep WHILE ( nAt <= Len( aData ) )

   RELEASE FONT oFont

return nil


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Reporte con Doble Renglon

Postby nageswaragunupudi » Sun Nov 01, 2020 7:53 am

FOR I := 35 TO 1 STEP -1
IF SUBSTR(_ccCadena1,I,1) = " "
Column Title "Nombre" Data SubStr(aDatDetalle[nRegis,3],1,I) SIZE 35 FONT 2
_ccCadena2 := SubStr(aDatDetalle[nRegis,3],I+1)
EXIT
ENDIF
NEXT


It is much easier to use MLCount() and MemoLine()

nLines := MLCount( cText, nLen )
cLine1 := MemoLine( cText, nLen, 1 )
cLine2 := MemoLine( cText, nLen, 2 )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 70 guests