Page 1 of 1

Bug Exportar Excel en Report

PostPosted: Sat Nov 16, 2019 2:21 pm
by MOISES
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: Select all  Expand view
ACCESS CanExportToExcel INLINE If( ::oReport == nil, ::oDevice:bToExcel != nil, ;
                                  ( ::oReport:bInit != nil .or. ::oReport:bToExcel != nil ) )
 


Gracias.

Re: Bug Exportar Excel en Report

PostPosted: Sat Nov 16, 2019 3:12 pm
by cnavarro
Prueba este ejemplo desde la carpeta samples con el buildh.bat

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

Re: Bug Exportar Excel en Report

PostPosted: Sat Nov 16, 2019 3:21 pm
by MOISES
Tampoco funciona.

Re: Bug Exportar Excel en Report

PostPosted: Sat Nov 16, 2019 5:02 pm
by EASYSOFT
Moises

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

Saludos

Oscar

Re: Bug Exportar Excel en Report

PostPosted: Sat Nov 16, 2019 5:04 pm
by EASYSOFT
Me falta decir que yo lo tengo al inicio del reporte

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

Saludos
Oscar

Re: Bug Exportar Excel en Report

PostPosted: Sat Nov 16, 2019 5:28 pm
by MOISES
Sí, ya lo tengo puesto. Antes con FW 14.14 funciona bien.

Este es el código:

Code: Select all  Expand view
   #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
 

Re: Bug Exportar Excel en Report

PostPosted: Sun Nov 17, 2019 1:47 pm
by nageswaragunupudi
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: Select all  Expand view
ACCESS CanExportToExcel INLINE If( ::oReport == nil, ::oDevice:bToExcel != nil, ;
                                  ( ::oReport:bInit != nil .or. ::oReport:bToExcel != nil ) )
 


Gracias.


We will look into this.

Re: Bug Exportar Excel en Report

PostPosted: Sun Nov 17, 2019 3:08 pm
by nageswaragunupudi
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: Select all  Expand view

      ACTIVATE DIALOG ::oRptWnd CENTERED
/*
      if Empty( ::oDevice:cFile )
         Eval( ::bPreview, ::oDevice )

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

      PrintEnd()
 


Please change these lines as:
Code: Select all  Expand view

      ACTIVATE DIALOG ::oRptWnd CENTERED

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


Please test after this change and let us know.

Re: Bug Exportar Excel en Report

PostPosted: Sun Nov 17, 2019 5:00 pm
by MOISES
Yes, the fix works perfect.

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

Re: Bug Exportar Excel en Report

PostPosted: Fri Dec 13, 2019 3:06 pm
by Sistem
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?

Re: Bug Exportar Excel en Report

PostPosted: Fri Dec 13, 2019 3:58 pm
by karinha
Code: Select all  Expand view

   IF DeOndePartiu = "IMPRIMEPDF"

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

   ENDIF
 

Re: Bug Exportar Excel en Report

PostPosted: Sat Dec 14, 2019 4:21 am
by nageswaragunupudi
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.