Page 2 of 4

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 6:38 am
by Antonio Linares

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 12:15 pm
by Armando
Antonio

Enviado, ojalá pronto tengamos excelentes noticias.

Saludos

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 5:27 pm
by Antonio Linares
Armando,

Recibido, gracias :-)

Basándome en la idea y en parte del código usado por Manuel, lo he implementado en la forma que entiendo más simple y que no requiere de muchos cambios en la apariencia a la que los usuarios estan acostumbrados. Va incluido en FWH 13.07.

Image

Nuevos métodos en la Clase TPreview: PrintersMenu() y SelPrinter( cPrinter )

En rpreview.prg hacer estos cambios:

Code: Select all  Expand view
     DEFINE TBMENU OF oBar ;
         ACTION  If( ValType( ::bPrint ) == 'B', Eval( ::bPrint, Self ), ::PrintPage() ) ;
         TOOLTIP Strtran( TXT_PRINT, "&", "" ) ;
         MESSAGE TXT_PRINT_CURRENT_PAGE ;
         MENU    ::PrintersMenu()

      /*
      DEFINE TBBUTTON OF oBar ;
         ACTION  If( ValType( ::bPrint ) == 'B', Eval( ::bPrint, Self ), ::PrintPage() ) ;
         TOOLTIP Strtran( TXT_PRINT, "&", "" ) ;
         MESSAGE TXT_PRINT_CURRENT_PAGE ;
         MENU    ::PrintersMenu()
      */
 


Code: Select all  Expand view
     DEFINE BUTTON RESOURCE "Printer2" OF oBar GROUP ;
         MENU ::PrintersMenu() ;
         MESSAGE TXT_PRINT_CURRENT_PAGE            ;
         ACTION  If( ValType( ::bPrint ) == 'B', Eval( ::bPrint, Self ), ::PrintPage() ) ;
         TOOLTIP Strtran( TXT_PRINT, "&", "" )        
 


Code: Select all  Expand view
METHOD SelPrinter( cPrinter ) CLASS TPreview

   local cOldPrinter := GetProfString( "windows", "device" , "" )

   WriteProfString( "windows", "device", cPrinter )
   SysRefresh()
   PrinterInit()

   DeleteDC( ::oDevice:hDC )

   ::oDevice:hDC    = GetPrintDefault( GetActiveWindow() )
   ::oDevice:cModel = cPrinter
   
   SysRefresh()
   WriteProfString( "windows", "device", cPrinter )

RETURN nil


Code: Select all  Expand view
METHOD PrintersMenu() CLASS TPreview

   local oPop, aPrinters := aGetPrinters()

   MENU oPop POPUP
      oPop:l2007 = ( nStyle == 2007 )
      oPop:l2010 = ( nStyle == 2010 )

      AEval( aPrinters, { | cPrinter | MenuAddItem( cPrinter,,;
             cPrinter $ ::oDevice:cModel,,;
             { | oMenuItem | ::SelPrinter( oMenuItem:cPrompt ) } ) } )
   ENDMENU

return oPop

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 5:52 pm
by elvira
Maestro,

Por favor, ¿podrías añadir exportar a Excel?.

¿Y poner un icono más moderno de Word por favor?.

Asimismo, el guardar a PDF debería tener su propio Icono autónomo.

También, para quedar de 10, falta enviar por email en pdf, con DEFINE MAIL.

Muy agradecida.

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 5:53 pm
by cnavarro
Antonio, no se podría poner también el número de páginas totales del informe?
Por lo menos en mi versión no aparece.
Code: Select all  Expand view


         @ 7, nCol SAY ::oPage PROMPT TXT_PAGENUM + ":  "+;
              LTrim( Str( ::nPage, 4, 0 ) ) + " / " + ;    // " de "
              LTrim( Str( Len( ::oDevice:aMeta ) ) ) ;
              SIZE 180, 15 PIXEL OF ::oBar FONT ::oFont

 


Saludos

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 5:58 pm
by Antonio Linares
Cristobal,

Aqui aparece bien el número total de páginas:

Image

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 6:01 pm
by elvira
Para exportar a Excel:

//--------------------------------------------------------------------------------------------------
FUNCTION RPreviewExportarExcel( oReport )

LOCAL oError

TRY

oReport:ToExcel()




CATCH oError

MsgStop("ERROR: No ha sido posible exportar a Excel"+CRLF+CRLF+"Subsistema: "+oError:Subsystem+CRLF+"Operación: "+oError:Operation+CRLF+"Descripción: "+oError:Description, " E R R O R ")


END



RETURN NIL
//--------------------------------------------------------------------------------------------------

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 6:02 pm
by elvira
DEFINE TBBUTTON OF oBar ;
ACTION RPreviewExportarExcel( oReport ) ;
TOOLTIP "Exportar a Excel" ;
MESSAGE "Exporta a formato Excel" ;
WHEN oReport != NIl

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 6:05 pm
by cnavarro
Gracias
Entonces es mi version
Lo he dicho por la imagen que has puesto antes
Saludos

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 6:16 pm
by Antonio Linares
Elvira,

Que imagen propones para el icono de Word ? Creo que esta es la más reciente pero es demasiada compleja para un bitmap de 16x16 que es el tamaño que nosotros usamos:

Image

En cuanto a las otras mejoras que comentas, estamos en ello y las publicaremos pronto :-)

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 6:19 pm
by Armando
Antonio:

Excelente, más rápido que una pizza :D , voy a hacer los cambios.

Elvira, para cambiar el icono puedes hacerlo editando el Prev32.Dll.

Saludos

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 6:26 pm
by Antonio Linares
Elvira,

gracias! :-)

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 6:50 pm
by elvira
Antonio,

Te adjunto nuestro .dll:
http://uploaded.net/file/jqtnoyc3

Igualmente, me gustaría sugerirte que la Barra fuese una Ribbon Bar look 2010 o, al menos, una Rebar como tenemos nosotros ahora, y se ve bastante bonito:
Image

Muchas gracias.

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 7:13 pm
by Antonio Linares
Elvira,

gracias a ti por tus sugerencias y aportaciones que estas haciendo :-)

Si nos guiamos por la estética de Windows 8, la actual toolbar que usa FWH se ve más "plana" que una rebar. La tendencia es eliminar degradados en superficies pequeñas y que se vean "planas".

Re: RPreview más reciente

PostPosted: Sat Jul 20, 2013 7:22 pm
by elvira
Maestro,

Gracias a vosotros por vuestra inestimable ayuda y atención.

A mi el look del preview actual me recuerda a Windows 3.1

Quizás con una Ribbon clause 2013 o una barra con otros colores pudiera ser.

;)