ERROR WITH XBROWSE : TOEXCEL
ERROR WITH XBROWSE : TOEXCEL
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
Falconi Silvio
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: ERROR WITH XBROWSE : TOEXCEL
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.
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
G. N. Rao.
Hyderabad, India
Re: ERROR WITH XBROWSE : TOEXCEL
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 ?
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
Falconi Silvio
Re: ERROR WITH XBROWSE : TOEXCEL
I tried ... all run ok you're fantastic !!
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: ERROR WITH XBROWSE : TOEXCEL
Yes.I must insert oCol:bEditValue := aBrowse[ i, 1 ] instead of oCol:bStrData := aBrowse[ i, 1 ]
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
G. N. Rao.
Hyderabad, India
Re: ERROR WITH XBROWSE : TOEXCEL
Have you a minimal sample for this DATASOURCE command ?
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: ERROR WITH XBROWSE : TOEXCEL
We can write DATASOURCE instead of writing ARRAY,ALIAS, etc.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India