evaldohc Posted March 29, 2004 Report Share Posted March 29, 2004 Fiz um relatório usando PRINT, e estou com seguinte problema, quando imprimo em uma Jato de Tinta ou Laser configurada para 300 x 300 o relatório fica OK, porem qdo é impresso em uma Laser 600 x 600 ele fica minusculo, como posso fazer para o relatório se autoajustar sem perder o código ja escrito. Evaldo Quote Link to comment Share on other sites More sharing options...
gilmer Posted March 29, 2004 Report Share Posted March 29, 2004 Olá, Você terá que montar uma formula para calcular o tamanho do fonte utilizando os métodos nVertRes() e nHorzRes(): oPrn:nVertRes() oPrn:nHorzRes() Quote Link to comment Share on other sites More sharing options...
evaldohc Posted March 29, 2004 Author Report Share Posted March 29, 2004 Não consegui Segue código static function fImprime() *- Relatório Geral LOCAL oPrinter, oFont LOCAL nWith,nHeight ,; // label height nMargin ,; // Printing margin (.2 inches) nLblWid ,; // # labels width (2) nLblHei // # labels height (6) LOCAL nCounter ,; // counter of lbl on each page nRow ,; // current row nCol ,; // current col nOldRow // old row position CursorWait() if !fprocessa() return(NIL) endif PRINTER oPrinter PREVIEW NAME "Estoque de Painéis Lisos e Perfis" oPrinter:setpage(9) && 9= A4 *oPrinter:setlandscape() DEFINE BRUSH oPBrush COLOR CLR_HGRAY DEFINE FONT oFont NAME "Arial" SIZE 0, +52 bold DEFINE FONT oFont1 NAME "Arial" SIZE 0, +32 bold DEFINE FONT oFont2 NAME "Arial" SIZE 0, +62 bold DEFINE FONT oFont3 NAME "Arial" SIZE 0, +36 bold nWidth := (oPrinter:nHorzRes() -10) nHeight := (oPrinter:nVertRes()+116)/66 nMargin := Int(oPrinter:nLogPixelX()*0.2) nCounter := 1 //------------------------------------------------------------------------// sele TEMPO01 set filter to QTDCAN+MINCAN+FABRICAR+QTDLISO+COMPRAR<>0 go top lPrimeira:= .t. DO WHILE ! Eof() nMINCAN:=0 nQTDCAN:=0 nFABRICAR:=0 nQTDLISO:=0 nCOMPRAR:=0 XPRODUTO = PRODUTO if .not. lPrimeira nRow += oFont2:nHeight * 4 fCabec1(oPrinter,nRow,nCol,oFont,oFont1,oFont2,oFont3,xPRODUTO) endif DO WHILE XPRODUTO==PRODUTO IF nCounter == 1 nRow := nMargin nCol := nMargin oPrinter:StartPage() if cLogo = "S" oPrinter:SayBitmap(.05,.52,"Logo.bmp",1.4,.7) endif nRow += oFont2:nHeight fCabec1(oPrinter,nRow,nCol,oFont,oFont1,oFont2,oFont3,xPRODUTO) lPrimeira:=.f. ENDIF nOldRow := nRow if (nCOUNTER/2)#int(nCOUNTER/2) .or. "Barra"$xPRODUTO oPrinter:Fillrect({nRow+280,nCol+15,nRow+325,nCol+2220},oPBrush) endif if !"Barra"$xPRODUTO oPrinter:Say( nRow + 285, nCol + 015, TEMPO01->COR, oFont3) endif oPrinter:Say( nRow + 285, nCol + 400, transform(TEMPO01->MINCAN,'@E 999,999'), oFont3) oPrinter:Say( nRow + 285, nCol + 800, transform(TEMPO01->QTDCAN,'@E 999,999'), oFont3) oPrinter:Say( nRow + 285, nCol + 1200, transform(TEMPO01->FABRICAR,'@E 999,999'),oFont3) oPrinter:Say( nRow + 285, nCol + 1600, transform(TEMPO01->QTDLISO,'@E 999,999'), oFont3) oPrinter:Say( nRow + 285, nCol + 2000, transform(TEMPO01->COMPRAR,'@E 999,999'), oFont3) nMINCAN = nMINCAN + TEMPO01->MINCAN nQTDCAN = nQTDCAN + TEMPO01->QTDCAN nFABRICAR = nFABRICAR + TEMPO01->FABRICAR nQTDLISO = nQTDLISO + TEMPO01->QTDLISO nCOMPRAR = nCOMPRAR + TEMPO01->COMPRAR nRow+=oFont3:nHeight nRow+=(oFont3:nHeight/2.5) SELE TEMPO01 TEMPO01->(DbSkip()) IF nCounter >= 61 .AND. !TEMPO01->(Eof()) nCounter := 1 oPrinter:EndPage() lPrimeira:=.f. ELSE nCounter++ ENDIF ENDDO nRow+=oFont3:nHeight oPrinter:Say( nRow + 230, nCol + 15,REPLICATE("_",130), oFont3 ) if !"Barra"$xPRODUTO oPrinter:Say( nRow + 285, nCol + 015, "Total", oFont3) oPrinter:Say( nRow + 285, nCol + 400, transform(nMINCAN,'@E 999,999'), oFont3) oPrinter:Say( nRow + 285, nCol + 800, transform(nQTDCAN,'@E 999,999'), oFont3) oPrinter:Say( nRow + 285, nCol + 1200, transform(nFABRICAR,'@E 999,999'),oFont3) oPrinter:Say( nRow + 285, nCol + 1600, transform(nQTDLISO,'@E 999,999'), oFont3) oPrinter:Say( nRow + 285, nCol + 2000, transform(nCOMPRAR,'@E 999,999'), oFont3) oPrinter:Say( nRow + 300 , nCol + 15,REPLICATE("_",130), oFont3 ) nRow+=oFont3:nHeight endif ENDDO CursorArrow() oPrinter:EndPage() oPrinter:Preview() Quote Link to comment Share on other sites More sharing options...
vagner Posted March 29, 2004 Report Share Posted March 29, 2004 Evaldo, nMult := (oPrn:nVertRes()/300) DEFINE BRUSH oPBrush COLOR CLR_HGRAY DEFINE FONT oFont NAME "Arial" SIZE 0, +52*nMult bold DEFINE FONT oFont1 NAME "Arial" SIZE 0, +32*nMult bold DEFINE FONT oFont2 NAME "Arial" SIZE 0, +62*nMult bold DEFINE FONT oFont3 NAME "Arial" SIZE 0, +36*nMult bold tome cuidado com o tamanho de linhas Abraços Vagner Wirts São Paulo-Brasil Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.