FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Bug Exportar Excel en Report
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Bug Exportar Excel en Report
Posted: Sat Nov 16, 2019 02:21 PM
Hola:

En samples\report.prg, al hacer el preview del Report el bot贸n de exportar a Excel est谩 inactivo y no funciona.

En la FW 14.14 todo OK, en rpreview.prg el valor oReport no llega bien ahora, y por eso no exporta:

Code (fw): Select all Collapse
ACCESS CanExportToExcel INLINE If( ::oReport == nil, ::oDevice:bToExcel != nil, ;
                                  ( ::oReport:bInit != nil .or. ::oReport:bToExcel != nil ) )


Gracias.
Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Bug Exportar Excel en Report
Posted: Sat Nov 16, 2019 03:12 PM

Prueba este ejemplo desde la carpeta samples con el buildh.bat

viewtopic.php?f=6t=37293p=222960hilit=report+to+excel#p222836

&&&

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: Bug Exportar Excel en Report
Posted: Sat Nov 16, 2019 03:21 PM

Tampoco funciona.

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 195
Joined: Sat Oct 22, 2005 01:17 PM
Re: Bug Exportar Excel en Report
Posted: Sat Nov 16, 2019 05:02 PM

Moises

Buenas tardes, posiblemente falte esta instrucci贸n
oReport:bInit := { || dbGoTop() }

Saludos

Oscar

Saludos

Oscar

Fwh 23.10, bcc55

Posts: 195
Joined: Sat Oct 22, 2005 01:17 PM
Re: Bug Exportar Excel en Report
Posted: Sat Nov 16, 2019 05:04 PM

Me falta decir que yo lo tengo al inicio del reporte

   PREVIEW   // TO PRINTER
  oReport:oDevice:SetPage(15)
  oReport:bInit := { || dbGoTop()  }

Saludos
Oscar

Saludos

Oscar

Fwh 23.10, bcc55

Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: Bug Exportar Excel en Report
Posted: Sat Nov 16, 2019 05:28 PM
S铆, ya lo tengo puesto. Antes con FW 14.14 funciona bien.

Este es el c贸digo:

Code (fw): Select all Collapse
    #include "fivewin.ch"
    #include "report.ch"

    REQUEST DBFCDX

    function Main()

      local oRep, oFont

       USE CUSTOMER NEW SHARED VIA "DBFCDX"
       SET FILTER TO RECNO() <= 20
       GO TOP

       DEFINE FONT oFont NAME "TAHOMA"  SIZE 0,-12
       REPORT oRep PREVIEW FONT oFont

oRep:bInit := { || dbGoTop() }


       COLUMN TITLE "NAME" DATA FIELD->FIRST
       COLUMN TITLE "CITY" DATA FIELD->CITY

       ENDREPORT

       oRep:bInit := { || CUSTOMER->( DBGOTOP() ) }

       ACTIVATE REPORT oRep

       RELEASE FONT oFont

    return nil
Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Bug Exportar Excel en Report
Posted: Sun Nov 17, 2019 01:47 PM
MOISES wrote:Hola:

En samples\report.prg, al hacer el preview del Report el bot贸n de exportar a Excel est谩 inactivo y no funciona.

En la FW 14.14 todo OK, en rpreview.prg el valor oReport no llega bien ahora, y por eso no exporta:

Code (fw): Select all Collapse
ACCESS CanExportToExcel INLINE If( ::oReport == nil, ::oDevice:bToExcel != nil, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ( ::oReport:bInit != nil .or. ::oReport:bToExcel != nil ) )


Gracias.


We will look into this.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Bug Exportar Excel en Report
Posted: Sun Nov 17, 2019 03:08 PM
You are right. Thanks for pointing this out.

This is a bug introduced in FWH1909 and effects this version only.
Fixed in the next version to be released.

Till then, please apply this fix by modifying report.prg

In the METHOD Activate() of TReport class in report.prg, please locate these lines 912 to 923
Code (fw): Select all Collapse
      ACTIVATE DIALOG ::oRptWnd CENTERED
/*
      if Empty( ::cFile )
         Eval( ::bPreview, ::oDevice )

      elseif "pdf" $ Lower( ::cFile )
         FWSavePreviewToPDF( ::oDevice,;
               If( Lower( cFileExt( ::cFile ) ) == "pdf", ;
               ::cFile, nil ), ::lPreview )
      endif
*/
      PrintEnd()


Please change these lines as:
Code (fw): Select all Collapse
      ACTIVATE DIALOG ::oRptWnd CENTERED

      if Empty( ::oDevice:cFile )
         Eval( ::bPreview, ::oDevice )
      else
         PrintEnd()
      endif


Please test after this change and let us know.
Regards



G. N. Rao.

Hyderabad, India
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: Bug Exportar Excel en Report
Posted: Sun Nov 17, 2019 05:00 PM

Yes, the fix works perfect.

When do you plan to rel茅ase a new build?

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 226
Joined: Sun May 13, 2012 07:52 AM
Re: Bug Exportar Excel en Report
Posted: Fri Dec 13, 2019 03:06 PM

estou tendo problema ao finalizar o repot

Descri莽茫o do Erro:
Error BASE/1004 Class: 'NIL' has no exported method: LMETA
[ 1] = U

chamado por LMETA(0)
chamado por PRINTEND(1766)
chamado por TREPORT:ACTIVATE(929)

alguem tem esse problema?

FWH2008 | xHarbour | BCC74 | SQLRDD
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Bug Exportar Excel en Report
Posted: Fri Dec 13, 2019 03:58 PM
Code (fw): Select all Collapse
   IF DeOndePartiu = "IMPRIMEPDF"

      oPrn:lMeta = .F.  // .T.

   ENDIF
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Bug Exportar Excel en Report
Posted: Sat Dec 14, 2019 04:21 AM
Sistem wrote:estou tendo problema ao finalizar o repot

Descri莽茫o do Erro:
Error BASE/1004 Class: 'NIL' has no exported method: LMETA
[ 1] = U

chamado por LMETA(0)
chamado por PRINTEND(1766)
chamado por TREPORT:ACTIVATE(929)

alguem tem esse problema?


Are you getting this error with FWH1903?
Or FWH1909?
If FWH1909, did you make the correction I posted above?

Can you also post your code, how you defined the REPORT?

Your answers will help us to find if there are any bugs and fix them if required.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion