Nuevamente con este tema, ya que no puedo encontrar el Problema de porque no me justifica la Impresión...
Esta es la Funcion que Uso.....
- Code: Select all Expand view
- * cTxt = Texto a Imprimir
* oPrn
* nRow = Linea
* nCol = Columna
* nWid = Tope de Columa a la Derecha
* oFont = Letra
* nSkp = Tamaño de Salto de Linea
* nClr =
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)
WHILE lCont // un desmadre para separar
cLin := cC := "" // y justificar los memos!!
lNext := .T.
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<>" "
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 (nRow)
y la llamo así
- Code: Select all Expand view
- line := Imp_MemoW((ECOINTE)->V_TEXT ,;
oPrn ,;
line ,;
If((ECOINMO)->IMP_IMDE==0 , 5.5 , 2+Espacio) ,;
19 ,;
oFont2 ,;
0.5)
(ECOINTE)->V_TEXT es la variable o campo MEMO.
Desde Ya muchas gracias...
Saludos
David
Argentina