Preview no genera archivo Excel

Preview no genera archivo Excel

Postby pedroluis » Sat Jun 16, 2018 11:09 am

Hola Señores !
Tengo un tema que me está inquietando y por más que he buscado no logré resolverlo.

Estoy trabajando con FWH 17.09 y tengo problemas con los listados, que una vez impresos (con PREVIEW),
al querer exportarlos a Excel.

Tengo 2 equipos
Los 2 tienen Office 2007
1 equipo tiene windows 7 64 bits y
el otro windows 7 32 bits.

En el equipo de 32 bits exporta a excel perfectamente.
En el equipo de 64 bits me da el siguiente mensaje "Excel no está instalado"
NOTA: Tampoco abre el Excel con la FileXLS.lib de R.Avendaño.
Será la versión de Excel la que está complicando las cosas ???

Alguna idea ???

Muchas Gracias !

Code: Select all  Expand view

 *--------------------------------------
FUNCTION VTA0110L( oLbx )
*--------------------------------------
local oReport
local oFont1
local oFont2
go top

DEFINE FONT oFont1 NAME "Arial" SIZE 0,-10    
DEFINE FONT oFont2 NAME "Arial" SIZE 1,-10    

REPORT oReport;
   TITLE "LISTADO DE CAJEROS" FONT oFont1, oFont2 ;
   HEADER "Fecha: " + DToC( Date() ) , "Hora: " + Time() ;
   FOOTER "Página: " + Str( oReport:nPage, 3 ) ;
   PREVIEW NAME "Cajeros" MODAL ;
   CAPTION "Cajeros"

COLUMN TITLE "NUMERO" DATA cajero
COLUMN TITLE "NOMBRE" DATA nombre
END REPORT

oReport:bInit:={||.t.}        
oReport:bInit := { || dbGoTop() }

ACTIVATE REPORT oReport
oFont1:End()
oFont2:End()
GO TOP
return nil  
 
Pedro L. Lavallen
San Luis (Capital), Argentina
User avatar
pedroluis
 
Posts: 117
Joined: Sun Oct 08, 2017 12:51 pm
Location: San Luis (Capital), Argentina

Re: Preview no genera archivo Excel

Postby karinha » Tue Jun 19, 2018 1:48 pm

Prueba con este ejemplo,

Code: Select all  Expand view

// More reports...

#include "report.ch"
#include "FiveWin.ch"

STATIC oReport

Function Main()

     LOCAL oWnd

     USE Customer ALIAS Test
     INDEX ON Test->State TO CustStat
     SET INDEX TO CustStat

     DEFINE DIALOG oWnd TITLE "Prueba informes" ;
          FROM 10,10 TO 18,50

     @ 2, 8.5 BUTTON "Imprimir" ;
          DEFAULT OF oWnd  ;
          SIZE 50,15          ;
          ACTION Report()

     ACTIVATE DIALOG oWnd


RETURN NIL


//----------------------------------------------------------------------------//

Function Report()

     LOCAL oFont1, oFont2, oFont3

     DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10
     DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-10 BOLD
     DEFINE FONT oFont3 NAME "ARIAL" SIZE 0,-10 BOLD ITALIC

     GO TOP

     REPORT oReport ;
          TITLE  "*** LISTADO DE PRUEBA ***",;
                 "",;
                 OemtoAnsi("FiveTech Software"),;
                 "" ;
          FONT   oFont1,;
                 oFont2,;
                 oFont3 ;
          HEADER "Fecha: "+dtoc(date()),;
                 "Hora:  "+time() ;
                 RIGHT ;
          FOOTER OemtoAnsi("P gina: ")+str(oReport:nPage,3) ;
                 CENTERED ;
                 PREVIEW

     GROUP ON Test->State ;
           FOOTER "Total Estado "+oReport:aGroups[1]:cValue ;
           FONT 2

     COLUMN TITLE "ST" ;
          DATA Test->State ;
          FONT 2

     COLUMN TITLE "City" ;
          DATA Test->City

     COLUMN TITLE "First Name","Last Name" ;
          DATA Test->First, Test->Last

     COLUMN TITLE "   Salary" ;
          DATA Test->Salary ;
          PICTURE "9,999,999" ;
          SIZE 9 ;
          TOTAL
          //RIGHT

     END REPORT


     IF !oReport:lCreated
          RETU NIL
     ENDIF

     /*
     Primera linea del titulo en negrita
     */


     oReport:oTitle:aFont[1] := {|| 2 }

     /*
     Poner en italica  cuando el salario es mas de 100.000
     */


     oReport:aColumns[4]:bDataFont := {|| iif(Test->Salary>100000,3 ,1 ) }

     ACTIVATE REPORT oReport ON STARTGROUP oReport:NewLine() ;
                             ON INIT Datos()

RETURN NIL

Function Datos()

   local cText

   cText := "Ancho hoja    : "+str(oReport:nWidth)+CRLF
   cText += "Alto hoja     : "+str(oReport:nHeight)+CRLF
   cText += "Ancho listado : "+str(oReport:nRptWidth)+CRLF
   cText += "Margen Izquier: "+str(oReport:nLeftMargin)+CRLF
   cText += "Margen Derecho: "+str(oReport:nRightMargin)+CRLF
   cText += "Ancho del Font: "+str(oReport:aFont[1]:nWidth)+CRLF
   cText += "Alto del Font:  "+str(oReport:aFont[1]:nHeight)+CRLF
   cText += "Ancho Standard: "+str(oReport:nSeparator)+CRLF
   cText += "Ancho columna1: "+str(oReport:aColumns[1]:nWidth)+CRLF
   cText += "Ancho columna2: "+str(oReport:aColumns[2]:nWidth)+CRLF
   cText += "nlogPixelsX   : "+str(oReport:oDevice:nLogPixelX())+CRLF
   cText += "nlogPixelsY   : "+str(oReport:oDevice:nLogPixelY())+CRLF
   cText += "Horzside      : "+str(oReport:oDevice:nHorzsize())+CRLF
   cText += "Vertside      : "+str(oReport:oDevice:nVertsize())+CRLF

   //     Alert(cText)

RETURN NIL
 


Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7415
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 57 guests

cron