ERROR WITH XBROWSE : TOEXCEL

ERROR WITH XBROWSE : TOEXCEL

Postby Silvio » Thu Apr 21, 2011 11:59 am

Image

I HAVE A XBROWSE and I MADE

ACTION (CursorWait(), oApp():oGrid:ToExcel(), CursorArrow());

and it made an error why ?????

Application
===========
Path and name: C:\Work\Prg2\rux\main.Exe (32 bits)
Size: 3,516,416 bytes
Time from start: 0 hours 1 mins 9 secs
Error occurred at: 21-04-2011, 13:56:33
Error description: Error BASE/2022 Parametro errato: ALLTRIM
Args:
[ 1] = N 2

Stack Calls
===========
Called from: => ALLTRIM(0)
Called from: Lib\xbrowse.prg => TXBRWCOLUMN:CLPTEXT(11000)
Called from: Lib\xbrowse.prg => TXBRWIN7:CLPROW(6149)
Called from: Lib\xbrowse.prg => TXBRWIN7:TOEXCEL(6714)
Called from: source\Rux.prg => (b)RUX(319)
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: ERROR WITH XBROWSE : TOEXCEL

Postby nageswaragunupudi » Thu Apr 21, 2011 3:10 pm

1) Please try setting oBrw:lExcelCellwise := .t., before calling oBrw:ToExcel(). You will not get this error.

2) The reason for error must be due to assigning a codeblock to oCol:bStrData returning a non-character value.
(a) Usage of bStrData has been deprecated long time back and it is recommended to use bEditValue. However, assignment to bStrData works for the sake of backward compatibility though many other features of xbrowse are not available in that case.
(b) As the name bStrData implies, ( string data ), the codeblock is expected to return a character value. Though efforts have been made to accommodate inadvertent assignment of codeblocks returning non-character values but only to the extent of display in the browse.
(c) Recommend using bEditValue instead of bStrData.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ERROR WITH XBROWSE : TOEXCEL

Postby Silvio » Fri Apr 22, 2011 8:33 am

thanks Rao,

a Question :

I use

FOR i := 1 TO Len(aBrowse)
oCol := oApp():oGrid:AddCol()
oCol:bStrData := aBrowse[ i, 1 ]
oCol:cHeader := aBrowse[ i, 2 ]
oCol:nWidth := aBrowse[ i, 3 ]
if !Empty(aBrowse[ i, 4 ])
oCol:cEditPicture:=aBrowse[ i, 4 ]
Endif
NEXT


I must insert oCol:bEditValue := aBrowse[ i, 1 ] instead of oCol:bStrData := aBrowse[ i, 1 ]

I understood ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: ERROR WITH XBROWSE : TOEXCEL

Postby Silvio » Fri Apr 22, 2011 8:38 am

I tried ... all run ok you're fantastic !!
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: ERROR WITH XBROWSE : TOEXCEL

Postby nageswaragunupudi » Fri Apr 22, 2011 5:18 pm

I must insert oCol:bEditValue := aBrowse[ i, 1 ] instead of oCol:bStrData := aBrowse[ i, 1 ]

Yes.
Glad it works.

This is just for information:
You first define all parameters in an array and then populate the codeblocks, headers, etc to columns of xbrowse.
This is very much simplified in the recent versions of xbrowse.

Define a multi-dimensional array in this format:
aCols := { ;
{ <uData1>, [<cHeader1>], [<cPicture1>], [<nWidth1>], [<lnJustify1>], [<cnSort1>] }, ;
....
{ <uDataN>, [<cHeaderN>], [<cPictureN>], [<nWidthN>], [<lnJustifyN>], [<cnSortN>] }}

Second element onwards are optional.

Simply write
@ 0,0 XBROWSE oBrw OF oWnd COLUMNS aCols DATASOURCE <uDataSource>

XBrowse autmatically assigns all the parameters to columns.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ERROR WITH XBROWSE : TOEXCEL

Postby Silvio » Fri Apr 22, 2011 9:36 pm

Have you a minimal sample for this DATASOURCE command ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: ERROR WITH XBROWSE : TOEXCEL

Postby nageswaragunupudi » Fri Apr 22, 2011 11:15 pm

We can write DATASOURCE instead of writing ARRAY,ALIAS, etc.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 99 guests