Page 1 of 1

¿Cómo activo el botón XLS del Preview?

Posted: Mon Jun 10, 2019 4:55 am
by wyerco613
Estimados

Buenas noches, ¿Cómo activo el botón XLS del Preview? el de PDF y de WORD están activados y funcionan bien pero este sale "disabled". Ya me he revisado varios prg´s

inclusive FIVEDBU y no lo encontre (a propósito no permite imprimir la estructura de una tabla y tampoco modificarla, se podría implementar. Saludos )

Muchas gracias desde ya.

Waldemar

Re: ¿Cómo activo el botón XLS del Preview?

Posted: Mon Jun 10, 2019 6:52 am
by nageswaragunupudi
If you are generating a preview of a report with code like this:

Code: Select all

   local oRep, oFont, oBold, oCol

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

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

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

   ENDREPORT

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

   ACTIVATE REPORT oRep

   RELEASE FONT oFont
 
Please insert this code after ENDREPORT and ACTIVATE REPORT

Code: Select all

   oRep:bInit := { || CUSTOMER->( DBGOTOP() ) }
 
Then, the Excel button of preivew works.
Without this, the preview does not work.

Re: ¿Cómo activo el botón XLS del Preview?

Posted: Thu Jun 13, 2019 12:19 am
by wyerco613
Dir Rao

I did what you said me. The sample:

Function ImpBoletas(cRut,cSocio)
Local oLis

Boletas->(DBGoTop())

REPORT oLis TITLE "BOLETAS DE "+cSocio,"","RUT "+cRut;
HEADER "SINDICATO",;
"Fecha: "+Dtoc(Date()),;
"Hora : "+Time() LEFT ;
FOOTER "Pag "+Str(oLis:nPage,3) CENTERED;
CAPTION "Boletas";
PREVIEW

COLUMN TITLE "FECHA" DATA Boletas->FECHA

COLUMN TITLE "Nº BOLETA" DATA Boletas->NUM_BOL

COLUMN TITLE "DETALLE" DATA Boletas->DETALLE

COLUMN TITLE "VALOR" DATA Boletas->VALOR;
PICTURE "@E 99,999,999";
RIGHT TOTAL

END REPORT

oLis:bInit := { || Boletas->( DBGOTOP() ) }

ACTIVATE REPORT oLis

//Boletas->(DBGoTop())

Return(NIL)

But don´t work, the bottom excel on the preview is disable yet.

I do someting bad?

Thank for your help

Waldemar

Re: ¿Cómo activo el botón XLS del Preview?

Posted: Thu Jun 13, 2019 7:07 pm
by nageswaragunupudi
What version of FWH you are using?

Re: ¿Cómo activo el botón XLS del Preview?

Posted: Sun Jun 16, 2019 8:59 am
by wyerco613
Drae Mr. Rao

My version is FWH 1903, and use pellesC


Best regards

Waldemar

Re: ¿Cómo activo el botón XLS del Preview?

Posted: Sun Jun 16, 2019 9:24 am
by nageswaragunupudi
Then it should work. Try clicking on excel button.
Just now this is the program I tested :
You may copy this program to \fwh\samples folder and run with buildh.bat or buildx.bat

Please make sure that you are not using any modifications to the fwh libraray.

Code: Select all

#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

   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
 
This is the result:
Image

Re: ¿Cómo activo el botón XLS del Preview?

Posted: Mon Jun 17, 2019 11:24 am
by wyerco613
Dear Rao

I´ve compiled and linked several examples like FiveDbu and the butttom excel preview works for that i beleave i have to acive some of clase xbrowse or of preiew,

what do you thing?

Best Regards

Waldemar

i use bcc7.

Re: ¿Cómo activo el botón XLS del Preview?

Posted: Mon Jun 17, 2019 12:25 pm
by nageswaragunupudi
Are you using any modified report.prg or modified rpreview.prg?

Re: ¿Cómo activo el botón XLS del Preview?

Posted: Wed Jun 19, 2019 12:55 am
by wyerco613
Dear Rao

No i did, but my prg (the main) i did not begin of zero I modified a old one (FWXH 13 i guest?), maybe that it is de problem. i've seen a lot prg's and in all cases the object is related to DATA bExcel.

example: oBrw:toExcel(parameters, I don´t know)

My problem is i need work with the classe in "report" and from preview

my email is waldemar@easycomp.cl

thank you very much

Waldemar González

Re: ¿Cómo activo el botón XLS del Preview?

Posted: Wed Jun 19, 2019 1:22 am
by nageswaragunupudi
1) You can call oBrw:ToExcel() without any parameters.
2) Export to Excel works from Preview of Report class.
3) I posted a sample above. Please copy the sample to \fwh\samples folder and build it with buildx.bat
Is this sample working for you correctly as expected?

Re: ¿Cómo activo el botón XLS del Preview?

Posted: Wed Jun 19, 2019 5:31 am
by wyerco613
nageswaragunupudi wrote:1) You can call oBrw:ToExcel() without any parameters.
2) Export to Excel works from Preview of Report class.
3) I posted a sample above. Please copy the sample to \fwh\samples folder and build it with buildx.bat
Is this sample working for you correctly as expected?
Dear Rao

1) I know that but i need more control about oBrw:ToExcel().
2) To me doesn´t work from Preview. I get 2 function`s give reports with preview and the excel buttom is Disabled.
3) I did and It works very well but when I call from may program it doesn' works.

my function:

Function ImpBoletas(cRut,cSocio)
Local oLis

//cBuscar:=Ctaarr->(Fieldget(3))+Str(Ctaarr->(Fieldget(6)),2)+Str(Ctaarr->(Fieldget(7)),4)
Boletas->(DBGoTop())

REPORT oLis TITLE "BOLETAS DE "+cSocio,"","RUT "+cRut;
HEADER "SINDICATO DE TRABAJADORES HONORARIOS",;
"Fecha: "+Dtoc(Date()),;
"Hora : "+Time() LEFT ;
FOOTER "Pag "+Str(oLis:nPage,3) CENTERED;
CAPTION "Boletas de Medicamentos";
PREVIEW

COLUMN TITLE "FECHA" DATA Boletas->FECHA

COLUMN TITLE "Nº BOLETA" DATA Boletas->NUM_BOL

COLUMN TITLE "DETALLE" DATA Boletas->DETALLE

COLUMN TITLE "VALOR" DATA Boletas->VALOR;
PICTURE "@E 99,999,999";
RIGHT TOTAL

END REPORT

oLis:bInit := { || Boletas->( DBGOTOP() ) }

ACTIVATE REPORT oLis

//Boletas->(DBGoTop())

Return(NIL)

Thanks

Best Regards

Waldemar