FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour EXCEL export
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
EXCEL export
Posted: Wed Mar 10, 2021 10:05 AM

Dear Mr. Rao,
I want to test the EXCEL export from the preview.
I'm testing version 21-01 and yunos.prg.
I would now like to start the EXCEL export from the invoice preview.
However, the button cannot be activated.
Best regards,
Otto

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: EXCEL export
Posted: Wed Mar 10, 2021 11:44 AM

If the preview is from printer object, there is no way FWH can figure out how to export to excel.
The programmer has to first write his own function to export the contents to export to Excel and then set
oPrn:bToExcel := { |oPreview| OutExportToExcelFunction( oPreview ) }

If oPrn:bToExcel exists, the excel button in preview buttonbar gets enabled.

Regards



G. N. Rao.

Hyderabad, India
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: EXCEL export
Posted: Wed Mar 10, 2021 12:53 PM

Dear Mr. Rao,
Thank you.
I can't find out, where inside
C:\fwh_2021\samples\testrpt4.prg
I find the code for EXCEL export.

Here the button is active, but the program errors out.

Do you have a sample for TReport class.

Best regards,
Otto

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: EXCEL export
Posted: Wed Mar 10, 2021 01:39 PM

Please see my sample here.

viewtopic.php?f=3t=40063

&

Regards



G. N. Rao.

Hyderabad, India
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: EXCEL export
Posted: Wed Mar 10, 2021 05:39 PM
Dear Mr. Rao,
now I can select EXCEL but get an error with

GROUP ON renner->GRUPPE HEADER (renner->GRUPPE) FOOTER " " FONT 3
Time from start: 0 hours 0 mins 3 secs
Error occurred at: 10.03.2021, 18:32:34
Error description: Error Excel.Application:WORKBOOKS:ADD:ACTIVESHEET/3 DISP_E_MEMBERNOTFOUND: RANGE
Args:
[ 1] = O Excel.Application:WORKBOOKS:ADD:ACTIVESHEET:CELLS
[ 2] = N 6

I have uploaded my source code:

https://mybergland.com/fwforum/samples.zip

Best regards,
Otto
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: EXCEL export
Posted: Thu Mar 11, 2021 11:42 PM

Thanks for sharing your program which helped us to see the bug in TReport class.
Runtime error occurs when exporting to excel when the report has groups and first column has totals.
Fixed for the next version.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion