Page 1 of 1

bug FW_DBFTOEXCEL

Posted: Thu Jul 09, 2015 10:16 am
by MOISES
Hello,

I get this error:

Error description: (DOS Error -2147352567) WINOLE/1006 (0x800A03EC): _VALUE
Args:
[ 1] = A { ... }

Stack Calls
===========
Called from: => TOLEAUTO:_VALUE( 0 )
Called from: .\source\classes\DATABASE.PRG => (b)FW_DBFTOEXCEL( 1431 )

Re: bug FW_DBFTOEXCEL

Posted: Thu Jul 09, 2015 10:31 am
by MOISES
Hello,

I think the problem is related to empty dates.

Re: bug FW_DBFTOEXCEL

Posted: Thu Jul 09, 2015 11:52 am
by hmpaquito
Sí el error puede estar relacionado con fechas vacias.

http://fivetechsupport.com/forums/viewt ... 50#p169487


Parece que la solucion que dieron al problema en:
https://groups.google.com/forum/#!searc ... g4tZJLxQsJ

es esta:
oExcelSheet:Cells( 1, 1 ):Value := iif( Empty( dMyDate ), NIL, dMyDate )

Re: bug FW_DBFTOEXCEL

Posted: Thu Jul 09, 2015 2:30 pm
by MOISES
Hello,

Thank you. The problem is the function uses an Array:


if Empty( cFieldList )
cFieldList := ""
AEval( DbStruct(), { |a| cFieldList += "," + a[ 1 ] } )
cFieldList := Substr( cFieldList, 2 )
endif
aHead := HB_ATokens( cFieldList, "," )
nCols := Len( aHead )


bLine := &( "{||{" + cFieldList + "}}" )


DbEval( { || oRange:Rows( nRow ):Value := Eval( bLine ), nRow++ }, bFor, bWhile, nNext, nRec, lRest )

Re: bug FW_DBFTOEXCEL

Posted: Fri Jul 10, 2015 1:12 am
by nageswaragunupudi
Exporting by rows is a lot faster than exporting cell by cell.
We can extend the codeblock to scan for empty dates and substituting with nulls. But this again defeats the main purpose of speed. When I first made this function it was working for empty dates also correctly with xHarbour. I think sometime back Harbour also made some changes regarding empty dates.

Anyway I need to check this once again and see what to do.