Asignar bPrint de Tpreview

Asignar bPrint de Tpreview

Postby mastintin » Thu Aug 15, 2013 5:34 pm

Quiero personalizar el dialogo del Preview para dejarlo con el mismo look que el resto del programa . La opción correcta es usar el nuevo codeblock que se ha creado para tal efecto como ClassData bPrint . Pero :
¿ como es la forma mas correcta de asignarlo ? , ¿ Añadiendo código a La función Rpreview() ? . ¿ que otras soluciones mas elegantes aconsejais ? .
Gracias por vuestras respuestas .
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: Asignar bPrint de Tpreview

Postby nageswaragunupudi » Fri Aug 16, 2013 4:27 am

Purpose of bPrint is to enable you have your own dialog.
You need to write a function which replaces Method PrintPage(), in your style. Within the function, you can use all methods and data of TPreview.

bPrint := { |oRep| MyPrintPage( oRep ) }

function MyPrintPage( Self )

<here write your function as if you are replacing method PrintPage() >

return nil
Regards

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

Re: Asignar bPrint de Tpreview

Postby mastintin » Fri Aug 16, 2013 7:36 am

nageswaragunupudi wrote:Purpose of bPrint is to enable you have your own dialog.
You need to write a function which replaces Method PrintPage(), in your style. Within the function, you can use all methods and data of TPreview.

bPrint := { |oRep| MyPrintPage( oRep ) }

function MyPrintPage( Self )

<here write your function as if you are replacing method PrintPage() >

return nil


Right, but the question is where is the right place to assign the codeblock ? In the RPreview modified function ?
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: Asignar bPrint de Tpreview

Postby nageswaragunupudi » Fri Aug 16, 2013 12:19 pm

If you want the replacement globally for the entire application, then the best place is in the beginning of the program in function main().

RPreview():bPrint := <block>

If you want only for a single report, anytime before activating the report:

RPreview():bPrint := <block>
After printing the report
RPreview():bPrint := nil
Regards

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

Re: Asignar bPrint de Tpreview

Postby mastintin » Fri Aug 16, 2013 1:34 pm

nageswaragunupudi wrote:If you want the replacement globally for the entire application, then the best place is in the beginning of the program in function main().

RPreview():bPrint := <block>
l

Exactly this was looking. Thank you very much for the help
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: FiveWiDi and 49 guests