Guys:
With xbrowse I want send data to excel using :toExcel but only those registers that meet some condition
and not all data that is displayed in the xbrowse
is it posible?, could you give me an example, please
Thank you
send data to excel with some condition from xbrowse
send data to excel with some condition from xbrowse
fwh 17.12, harbour 3.2.0, pelles C, bcc7, Ms-Sql
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: send data to excel with some condition from xbrowse
This is not provided as a part of ToExcel() method.
However, there are two ways of doing it.
Approach-1
a) SetFilter to the condition. oBrw:Refresh()
b) ToExcel()
c) Clear filter and oBrw:Refresh()
Approach-2
a) Prepare an array of RecNo()s to be exported.
Example:
b) Assign oBrw:aSelected := aRecNo
c) oBrw:ToExcel()
d) Clear oBrw:aSelected := {}
To see how the second method works, first test this small sample
However, there are two ways of doing it.
Approach-1
a) SetFilter to the condition. oBrw:Refresh()
b) ToExcel()
c) Clear filter and oBrw:Refresh()
Approach-2
a) Prepare an array of RecNo()s to be exported.
Example:
Code: Select all
aRecNo := {}
( oBrw:cAlias )->( DBEVAL( { || AAdd( aRecNo, RECNO() ) }, { || your condtion } ) )
c) oBrw:ToExcel()
d) Clear oBrw:aSelected := {}
To see how the second method works, first test this small sample
Code: Select all
XBROWSER "STATES.DBF" SETUP ( oBrw:bRClicked := { |r,c,f,o| ;
o:aselected := { 2,3,4 }, o:ToExcel(), o:aselected := {} } )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: send data to excel with some condition from xbrowse
thank mr. rao,nageswaragunupudi wrote:
To see how the second method works, first test this small sampleCode: Select all
XBROWSER "STATES.DBF" SETUP ( oBrw:bRClicked := { |r,c,f,o| ; o:aselected := { 2,3,4 }, o:ToExcel(), o:aselected := {} } )
I use recordset, so how could be the sentence?
thanks in advance
fwh 17.12, harbour 3.2.0, pelles C, bcc7, Ms-Sql