FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour ¿Cómo activo el botón XLS del Preview?
Posts: 79
Joined: Wed Mar 06, 2019 08:28 PM
¿Cómo activo el botón XLS del Preview?
Posted: Mon Jun 10, 2019 04:55 AM

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

"Porque Jehová da la sabiduría , Y de su boca viene el conocimiento y la inteligencia Proverbios 2:6"

FWH 1903 + Bcc7 + PellesC + XEdit easycomp613@gmail.com

Waldemar
Colbún Chile
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ¿Cómo activo el botón XLS del Preview?
Posted: Mon Jun 10, 2019 06:52 AM
If you are generating a preview of a report with code like this:
Code (fw): Select all Collapse
   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 (fw): Select all Collapse
   oRep:bInit := { || CUSTOMER->( DBGOTOP() ) }

Then, the Excel button of preivew works.
Without this, the preview does not work.
Regards



G. N. Rao.

Hyderabad, India
Posts: 79
Joined: Wed Mar 06, 2019 08:28 PM
Re: ¿Cómo activo el botón XLS del Preview?
Posted: Thu Jun 13, 2019 12:19 AM

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

"Porque Jehová da la sabiduría , Y de su boca viene el conocimiento y la inteligencia Proverbios 2:6"

FWH 1903 + Bcc7 + PellesC + XEdit easycomp613@gmail.com

Waldemar
Colbún Chile
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ¿Cómo activo el botón XLS del Preview?
Posted: Thu Jun 13, 2019 07:07 PM

What version of FWH you are using?

Regards



G. N. Rao.

Hyderabad, India
Posts: 79
Joined: Wed Mar 06, 2019 08:28 PM
Re: ¿Cómo activo el botón XLS del Preview?
Posted: Sun Jun 16, 2019 08:59 AM

Drae Mr. Rao

My version is FWH 1903, and use pellesC

Best regards

Waldemar

"Porque Jehová da la sabiduría , Y de su boca viene el conocimiento y la inteligencia Proverbios 2:6"

FWH 1903 + Bcc7 + PellesC + XEdit easycomp613@gmail.com

Waldemar
Colbún Chile
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ¿Cómo activo el botón XLS del Preview?
Posted: Sun Jun 16, 2019 09:24 AM
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 (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

   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:
Regards



G. N. Rao.

Hyderabad, India
Posts: 79
Joined: Wed Mar 06, 2019 08:28 PM
Re: ¿Cómo activo el botón XLS del Preview?
Posted: Mon Jun 17, 2019 11:24 AM

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.

"Porque Jehová da la sabiduría , Y de su boca viene el conocimiento y la inteligencia Proverbios 2:6"

FWH 1903 + Bcc7 + PellesC + XEdit easycomp613@gmail.com

Waldemar
Colbún Chile
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ¿Cómo activo el botón XLS del Preview?
Posted: Mon Jun 17, 2019 12:25 PM

Are you using any modified report.prg or modified rpreview.prg?

Regards



G. N. Rao.

Hyderabad, India
Posts: 79
Joined: Wed Mar 06, 2019 08:28 PM
Re: ¿Cómo activo el botón XLS del Preview?
Posted: Wed Jun 19, 2019 12:55 AM

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

"Porque Jehová da la sabiduría , Y de su boca viene el conocimiento y la inteligencia Proverbios 2:6"

FWH 1903 + Bcc7 + PellesC + XEdit easycomp613@gmail.com

Waldemar
Colbún Chile
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ¿Cómo activo el botón XLS del Preview?
Posted: Wed Jun 19, 2019 01:22 AM

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?

Regards



G. N. Rao.

Hyderabad, India
Posts: 79
Joined: Wed Mar 06, 2019 08:28 PM
Re: ¿Cómo activo el botón XLS del Preview?
Posted: Wed Jun 19, 2019 05:31 AM
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
"Porque Jehová da la sabiduría , Y de su boca viene el conocimiento y la inteligencia Proverbios 2:6"

FWH 1903 + Bcc7 + PellesC + XEdit easycomp613@gmail.com

Waldemar
Colbún Chile

Continue the discussion