Can you tell me where I'm wrong or I'm doing wrong?
I'm trying to use the magnificent oReport METHOD: ToExcel ().I made the changes suggested in this post: viewtopic.php?f=3&t=23809&hilit=formula # p128306, but it don't works.
I modified the classe report.prg like this:
Line 2178:
- Code: Select all Expand view
- //oSheet:Cells( nRow, nCol ):Formula := "=SUBTOTAL(9," + cAdr + ")" //English
oSheet:Cells( nRow, nCol ):Formula := "=SUBTOTALES(9;" + cAdr + ")" //Spanish
Line 2288:
- Code: Select all Expand view
- //oSheet:Cells( nRow, nCol ):Formula := "=SUBTOTAL(9," + cAdr + ")" //English
oSheet:Cells( nRow, nCol ):Formula := "=SUBTOTALES(9;" + cAdr + ")" //Spanish
Line 2305:
- Code: Select all Expand view
- WITH OBJECT oSheet:Cells( nRow, nCol )
// :Formula := "=SUBTOTAL( 9, " + ; //English
:Formula := "=SUBTOTALES( 9; " + ; //Spanish
oSheet:Range( oSheet:Cells( nFirstRow, nCol ), ;
oSheet:Cells( nRow - 1, nCol ) ):Address( .f., .f. ) + ")"
END
It compiles fine but gives errors when running as the following picture:
Uploaded with ImageShack.us
The code I use is as follows: (It works well on commun reports, but not export to Excel)
- Code: Select all Expand view
- REPORT oReport;
TITLE EMPRESA, MEMBRE +" - "+SUCURSAL,;
"REPORTE DE INVENTARIO"+FECHADOR(dFecha);
HEADER "Pag No. "+alltrim(str(oReport:nPage)) RIGHT ;
FOOTER " "," "," "," "," ","Elaborado Por:___________________________________________ ", " ", " ", " " CENTERED ;
PREVIEW
COLUMNS....
END REPORT
IF oReport:lCreated
oReport:bStartPage:={|| oReport:aColumns[7]:ntotal:=0 }
oReport:bEndPage:={|| nTotAcum+=oReport:aColumns[7]:ntotal }
oReport:bPostEnd:={|| oReport:Say(1,"VALOR TOTAL DE INVENTARIO",2), oReport:Say(7,transform(nTotAcum,"9,999,999,999.99"),2) }
oReport:cPageTotal := "TOTAL DE ESTA PAGINA..."
oReport:cGrandTotal := "TOTAL DE ESTA PAGINA..."
oReport:bInit := {|| oMaeprodt:GoTop() } //oMaeprodt proviene de un MySql:Query(
oReport:bSkip := {|| oMaeprodt:Skip() }
oReport:ToExcel()
ENDIF
ACTIVATE REPORT oReport WHILE !oMaeprodt:eof()
.....
Best regards.
Fwh1204-xHarbour-MySql-TmySql
Windows 7 Ultimate - Excel 2007