Fix for DC_WorkArea2Excel() problem

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Fix for DC_WorkArea2Excel() problem

#1 Post by rdonnay »

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.
Attachments
_dcfunct.zip
(46.51 KiB) Downloaded 680 times
The eXpress train is coming - and it has more cars.

Dian
Posts: 21
Joined: Tue Feb 02, 2010 8:36 am
Location: Midland Texas

Re: Fix for DC_WorkArea2Excel() problem

#2 Post by Dian »

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

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Fix for DC_WorkArea2Excel() problem

#3 Post by rdonnay »

it is possible to copy the data from the memo field to the excel cell
Thanks Dian. I will look into this.
The eXpress train is coming - and it has more cars.

Post Reply