Richard Covington reported that his export routine suddenly started erroring in his application.
He uses DC_WorkArea2Excel() to export his DBF data to an Excel worksheet.
His data contains memo fields.
Whenever the contents of a memo field exceeded 1024 characters, it would crash the Excel ActiveX routine.
Here is an updated _DCFUNCT.PRG that now limits memo cells to 1024 characters.
Copy it to your \exp20\source\dclipx folder and run build19_sl1.bat or build20.bat to rebuild DCLIPX.DLL
This fix will be in build 264.
Fix for DC_WorkArea2Excel() problem
Fix for DC_WorkArea2Excel() problem
- Attachments
-
- _dcfunct.zip
- (46.51 KiB) Downloaded 782 times
The eXpress train is coming - and it has more cars.
Re: Fix for DC_WorkArea2Excel() problem
If the entire memo file needs to be in the excel file it is possible to copy the data from the memo field to the excel cell with the following command. Where astruct is the structure of the database table.
oworksheet:=obook:ActiveSheet
SELECT TMPDBF
DBGOTOP()
STORE 2 TO XPOS
DO WHILE !EOF()
FOR I:= 1 TO LEN(ASTRUCT)
IF ASTRUCT[I,2]$'M'
CDATA:=FIELDGET(I)
oWorkSheet:Cells( XPOS,I):Value:=CDATA
ENDIF
NEXT
XPOS++
SKIP
ENDDO
oworksheet:=obook:ActiveSheet
SELECT TMPDBF
DBGOTOP()
STORE 2 TO XPOS
DO WHILE !EOF()
FOR I:= 1 TO LEN(ASTRUCT)
IF ASTRUCT[I,2]$'M'
CDATA:=FIELDGET(I)
oWorkSheet:Cells( XPOS,I):Value:=CDATA
ENDIF
NEXT
XPOS++
SKIP
ENDDO
Re: Fix for DC_WorkArea2Excel() problem
Thanks Dian. I will look into this.it is possible to copy the data from the memo field to the excel cell
The eXpress train is coming - and it has more cars.