by luisduque » Thu Sep 10, 2015 7:24 am
Hola Leandro
como dice el Maestro Antonio Linares
Modifica la clase rpreview
METHOD PrintPage() CLASS TPreview
local hMeta := ::oMeta1:hMeta
local oDlg, oRad, oPageIni, oPageEnd
local nOption := 1, nFirst := 1, nLast := Len( ::oDevice:aMeta ) // DEVICE
local oThis := Self
local lCancel := .t.
if nLast != 1
DEFINE DIALOG oDlg SIZE 400, 183 TITLE FWString( "Printing" )
oDlg:lTruePixel := .f.
@ 8, 8 GROUP PROMPT FWString( "Printing range" ) SIZE 135, 72 PIXEL OF oDlg
@ 18, 18 RADIO oRad VAR nOption ;
ITEMS FWString( "All" ), FWString( "Current page" ), FWString( "Pages" ) ;
ON CHANGE If( nOption == 3,;
( oPageIni:Enable(), oPageEnd:Enable() ),;
( oPageIni:Disable(), oPageEnd:Disable() ) ) PIXEL
@ 61, 30 SAY FWString( "From" ) OF oDlg PIXEL
@ 60, 53 GET oPageIni ;
VAR nFirst PICTURE "@K 99999" ;
VALID If( nFirst < 1 .or. nFirst > nLast, ( MsgBeep(), .F. ), .T. ) ;
OF oDlg SIZE 22, 11 PIXEL
@ 61, 80 SAY FWString( "To" ) OF oDlg PIXEL
@ 60, 103 GET oPageEnd ;
VAR nLast PICTURE "@K 99999" ;
VALID If( nLast < nFirst .or. nLast > Len( ::oDevice:aMeta ),; // DEVICE
( MsgBeep(),.F. ), .T.) OF oDlg PIXEL
@ 10, 152 BUTTON FWString( "&Ok" ) OF oDlg SIZE 42, 14 ;
ACTION ( lCancel := .f., oDlg:End() ) PIXEL
@ 28, 152 BUTTON FWString( "&Cancel" ) OF oDlg SIZE 42, 14 ;
ACTION oDlg:End() PIXEL
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oPageIni:Disable(), oPageEnd:Disable(), .T. )
else
lCancel := .f.
endif
if ! lCancel
MsgRun( ::oDevice:cDocument, "Printing Report",;
{ || ::PrintPrv( nil, nOption, nFirst, nLast ) } )
endif
///puedes colocar lo que quieras hacer en mi caso me toco para una impresión particular salir al imprimir por medio de la variable zPrintTick que es una variable de mi software
If zPrintTick
::oWnd:End()
EndIf
///
return nil