Clipper/FiveWin - Imprimir Get Multiline

 
Vista:

Imprimir Get Multiline

Publicado por Luis (4 intervenciones) el 04/12/2008 02:12:36
Hola a todos:

Tengo un un GET MULTILINE que lo uso como campo memo carga el texto de la base
en forma correcta, pero cuando quiero imprimir ese dato que esta en una variable
no imprime, aqui el codigo fuente:

Local vVar3
...
REDEFINE GET oObj2 VAR vVar2 ID 114 OF oDlg1 PICTURE "XXXXXXXX";
VALID EMPTY(vVar2) .OR. Eval ( {|| (vAlias := Abrebase("Maeart","Maeart1",),;
Iif( (vAlias)->(Dbseek(vVar2)),;
( vVar3 := (vAlias)->descripm,; ------------> CAMPO MEMO
oObj3:Refresh() ),;
( Msgstop("Pedido NO Existe"),vVar3:=Space(10),oObj2:oJump:=oObj2,oObj3:Refresh(),.F.)) ),;
(vAlias)->(dbCloseArea()), .T. } )

REDEFINE GET oObj3 VAR vVar3 MULTILINE ID 108 OF oDlg1 ---> DATO MEMO OK
....

STATIC FUNCTION GENIMPFAC(vVar,vTot,vVar3)
Local oPrn, oFont, oFont1
LOCAL cText, cLine
LOCAL nFor, nLines

Printersetup()
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "Arial" SIZE 0, -08 OF oPrn
DEFINE FONT oFont1 NAME "Arial Negrita" SIZE 0, -10 OF oPrn

PAGE
oPrn:CmSay( 04.5,16, vVar[12]+" - "+vVar[13],oFont1 ) // SERIE - NUMERO --> OK
oPrn:CmSay( 07.3,02, vVar[01]+": "+vVar[02],oFont1 ) // NOM CLI --> OK
oPrn:CmSay( 08.6,03, vVar[05],oFont ) // RUC --> OK

cText := vVar3
nLines := MlCount(cText,50)

FOR nFor := 1 TO nLines

cLine := MemoLine(cText, 50, nFor)
oPrn:CmSay( 11.5,10, cLine,oFont ) // DISTRITO ---> NO IMPRIME

NEXT

oPrn:CmSay( 23.5,09, Trans(vTot[03],"999,999.99"),oFont ) // VAL VTA --> OK
oPrn:CmSay( 23.5,12, Trans(vTot[04],"999,999.99"),oFont ) // DSCTO --> OK
oPrn:CmSay( 23.5,15, Trans(vTot[02],"999,999.99"),oFont ) // IGV --> OK
oPrn:CmSay( 23.5,18, Trans(vTot[01],"999,999.99"),oFont ) // TOTAL --> OK

ENDPAGE
ENDPRINT

RETURN NIL

Alguien puede ayudarme a que esa variable del GET MULTILINE se pueda
imprimir?. Gracias de antemano.

Luis
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

RE:Imprimir Get Multiline

Publicado por Aida L Rios C (3 intervenciones) el 04/12/2008 14:15:43
Haz algo asi con un objeto report
espero esto te sirva
/*
// Si Desea Imprimir lineas Adicionales que no esten vacias

*/

// PrintMemo(CAMPOMEMO,1,.F.,1) // Imprimir Campo Memo

RETURN .T.

/*
// Imprime Campos Memos
*/
FUNCTION PrintMemo(cMemo,nCol,lData,nIni)
LOCAL nFor,aLines

IF Empty(cMemo)
RETURN ""
ENDIF

// Inicio del L­nea
DEFAULT nIni:=1

cMemo :=STRTRAN(cMemo,CHR(10),"") // Convierte el Campo Memo en Arreglos
aLines:=_VECTOR(cMemo,CHR(13))

IF lData // Requiera la Primera L­nea de Datos
Return aLines[1]
ENDIF

// oReport:BackLine(1) // Retroceder una L­nea
// oReport:Newline() // Adelanta una L­nea
FOR nFor := nIni TO LEN(aLines)
oReport:StartLine()
oReport:Say(nCol,aLines[nFor])
oReport:EndLine()
NEXT
oReport:Newline()

RETURN ""
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Imprimir Get Multiline

Publicado por Ramon Paredes (47 intervenciones) el 11/12/2008 02:00:22
usa esta funcion :

cTxt:= micampo ( El campo multilinea que tienes )
Imp_MemoW(cTxt,oPrn,3.5,6.5,9.0,oFn1,0.4,CLR_BLUE)


FUNCTION Imp_MemoW(cTxt,oPrn,nRow,nCol,nWid,oFont,nSkp,nClr)
LOCAL cLin, lCont:=.T., nP:=0, lNext, cC, nW
DEFAULT nSkp:=0.4, nClr:=0
cTxt:=Alltrim(cTxt)
nW:=nWid-0.2
nRow-=nSkp
oPrn:Cmtr2Pix(0,@nWid)
DO WHILE lCont // un desmadre para separar
cLin:=cC:="" // y justificar los memos!!
lNext:=.T.
DO WHILE oPrn:GetTextWidth(cLin,oFont)<nWid ;
.AND. nP<=Len(cTxt) .AND. lNext
nP++
cC:=Substr(cTxt,nP,1)
IF Asc(cC)<>13
cLin+=cC
ELSE
nP++
lNext:=.F.
ENDIF
ENDDO
IF Asc(cC)<>13 .AND. Asc(cC)<>0
cC:=Substr(cTxt,nP+1,1)
IF " "$cLin .AND. cC<>" "
DO WHILE cC<>" " .AND. Len(cLin)>0
cLin:=Substr(cLin,1,Len(cLin)-1)
cC:=Right(cLin,1)
nP--
ENDDO
ELSE
cLin:=Substr(cLin,1,Len(cLin)-2)+"-"
cC:=Right(cLin,1)
nP-=2
ENDIF
oPrn:CmSay(nRow+=nSkp,nCol,Alltrim(cLin),oFont,nW,nClr,,3)
ELSE
oPrn:CmSay(nRow+=nSkp,nCol,Alltrim(cLin),oFont,,nClr)
ENDIF
IF nP>=Len(cTxt)
lCont:=.F.
ENDIF
ENDDO
RETURN (Nil)

Elaborada y donada por nuestro amigo Fivewinero Alfredo Arteaga

Saludes desde Managua Nicaragua

Ramon Paredes
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar