xBrowse :ToExcel Method - Problem with Memo's?

Post Reply
angelo.c
Posts: 36
Joined: Thu Mar 30, 2006 11:19 am

xBrowse :ToExcel Method - Problem with Memo's?

Post by angelo.c »

Hello

I have some tables *.DBF with *.cdx indexes and some of them contain memo fields. The memo table is in *.fpt format. I am using the FWH / [x]Harbour xBrowse(...) function to do a quick browse of selected dbf tables and in some cases to export the table values to Excel for further processing. It works fine when there are no memo fields in the table. It gives the following error when a memo field is present:

Application
===========
Path and name: D:\ac\fwhdb_phx\Project\ph_win32.exe (32 bits)
Size: 3,793,920 bytes
Time from start: 0 hours 0 mins 48 secs
Error occurred at: 27/05/2009, 21:39:51
Error description: Error Excel.Application:ACTIVESHEET:COLUMNS/0 S_OK: _NUMBERFORMAT
Args:
[ 1] = C @d

Stack Calls
===========
Called from: source\rtl\win32ole.prg => TOLEAUTO:_NUMBERFORMAT(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:TOEXCEL(5207)
Called from: xBrowse_dbf.prg => (b)BTNBAR(154)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(443)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(629)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1453)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1283)
Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
Called from: => SYSREFRESH(0)
Called from: .\source\classes\folder.PRG => SYSWAIT(484)
Called from: xBrowse_dbf.prg => SHOW_DBF_IN_DIALOG(140)
Called from: xBrowse_dbf.prg => (b)XBROWSE_DBF(58)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(945)
Called from: xBrowse_dbf.prg => XBROWSE_DBF(58)
Called from: ph_win32.prg => (b)BUILDMENU(1215)
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND(437)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND(1003)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(952)
Called from: ph_win32.prg => MAIN(521)

[SNIP]

Variables in use
================
Procedure Type Value
==========================
TOLEAUTO:_NUMBERFORMAT
Param 1: C "@d"
Local 1: U
Local 2: C "Excel.Application:ACTIVESHEET:COLUMNS"
TXBROWSE:TOEXCEL
Local 1: U
Local 2: U
Local 3: O Class: TXBROWSE
Local 4: O Class: TOLEAUTO
Local 5: O Class: TOLEAUTO
Local 6: O Class: TOLEAUTO
Local 7: U
Local 8: N 15
Local 9: N 15
Local 10: O Class: TXBRWCOLUMN
Local 11: C "D"
Local 12: U
Local 13: N 260
Local 14: N 1
Local 15: N 1040
Local 16: A Len: 48
Local 17: U
Local 18: U
Local 19: U
Local 20: U
Local 21: C "0"
Local 22: A Len: 0
Local 23: L .F.
Local 24: L .T.
Local 25: U
(b)BTNBAR
Param 1: O Class: TBTNBMP
[SNIP]
Has anyone else had a similar problem?
If so, how did it get solved?

I'm using FiveWin V9.04 / [x]Harbour 1.2.1,
[x]Harbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)) and Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland,
Win XP Professional Windows version: 5.1, Build 2600 Service Pack 3



Best Regards,
Angelo.c
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse :ToExcel Method - Problem with Memo's?

Post by nageswaragunupudi »

I think the problem is not with memo fields, but with a date field in your browse. I also guess you have SET EXACT ON in your application.

The original code in xbrowse.prg at line 5206 is

Code: Select all

if ValType( oCol:cEditPicture ) == 'C' .and. !( oCol:cEditPicture = '@' )
Please try changing this line as

Code: Select all

if ValType( oCol:cEditPicture ) == 'C' .and. Left( oCol:cEditPicture, 1 ) != '@'
Please compile the modified xbrowse.prg and link to your application and see if your problem is solved.

It is also true that memo fields are not handled well in the ToExcel method of xbrowse. We get unexpected results when the memo contains tabs and crlfs.
Regards

G. N. Rao.
Hyderabad, India
angelo.c
Posts: 36
Joined: Thu Mar 30, 2006 11:19 am

Re: xBrowse :ToExcel Method - Problem with Memo's?

Post by angelo.c »

Thank you for quick response. Your suggestion worked well. The above problem is fixed.

Perhaps Antonio can include this minor change in the next release of FWH / [x]Harbour so that a custom version of xBrowse need not be generated for Fivewin applications?

Again, I thank you

Best Regards,
Angelo.c
Post Reply