FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index To do - WishList / Por hacer - Peticiones Generic TxBrowse()
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Generic TxBrowse()
Posted: Tue Jan 27, 2009 01:33 PM

To All

It would be wonderful if there was a TxBrowse() function in the FWH library like Browse(), that would take a couple of parameters .. one would be a .dbf or alias() .dbf parameter ( or current workarea ) and two .. an ADO recordset.

For me .. it would be nice to have a tool to quickly view an ADO recordset and pass it something like this TxBrowse( oRs )

Thanks
Rick Lipkin

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Generic TxBrowse()
Posted: Tue Jan 27, 2009 02:20 PM
Rick,

This is available since FWH 8.07:

8. New Function XBROWSE( [cAlias/aData/oRs/oDbf], [cTitle], [lAutoSort], [bSetUp] ) for quick browse of any datasource.
Example:
use customer
xbrowse()
or
xbrowse( aArray / oRs / oDbf / cAlias / hHash )
Additional features can be provided by the programmer through bSetUp codeblock, which receives the browse object
as parameter.


In FWH 8.08 it was enhanced:

6) XBrowse function Improvements:
XBrowse function works as Quick XBrowse of any datasource. By using the third paramter bSetUp, full power of
xBrowse can be exploited. Syntax:
XBrowse( [uData], [cTitle], [lAutoSort], [bSetUp], [bSelect] )

(a) Now XBrowse function works with TDatabase ( or similar objects ) also.
(b) By default XBrowse function provides three buttons Print, Excel and Close. If a fifth parameter bSelect is
specified, 'Select' button also is displayed and when pressed bSelect codeblock is evaluated with oBrw and
SelectedCol as parameters. This is useful to make Quick Pick Lists from any datasource.

There is a working example in:
FWH\samples\TestXbr3.prg
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Generic TxBrowse()
Posted: Tue Jan 27, 2009 02:55 PM

Antonio

Thanks .. pluged in Xbrowse( oRs ) and my first three columns are numeric values :

cSQL := "SELECT FAC.LOCAL_FACIL_EID AS LOCAL_FACIL_EID, "
cSQL += "FAC.EID as EID,"
cSQL += "FAC.TANK_OWNER_EID, "
cSQL += "FAC.SITE_NUM AS SITE_NUM, "
cSQL += "STANDARDTASKS.GETNAME( LOCAL_FACIL_EID,'NO_NUM' ) AS FACILITY, "
cSQL += "ADDR.ADDRESS_1 AS ADDRESS, "
cSQL += "ADDR.CITY AS CITY, "
cSQL += "ADDR.STATE_CODE AS STATE, "
cSQL += "STANDARDTASKS.GETNAME( FAC.TANK_OWNER_EID,'NO_NUM' ) AS OWNER, "
cSQL += "FAC.LOCKED_IND AS READ_ONLY "
cSQL += "from SUNTRACK.EFIS_UST_FACILITIES FAC, "
cSQL += "SUNTRACK.ADDRESSES ADDR "
cSQL += "where ADDR.OWNER_EID = FAC.LOCAL_FACIL_EID "
cSQL += "AND ADDR.ADDRESS_TYPE_CODE = 'BUSINESS' "
cSQL += "AND ADDR.STOP_DATE IS NULL "
cSQL += "AND STANDARDTASKS.GETNAME( FAC.TANK_OWNER_EID,'NO_NUM' )LIKE '"+cFIND+"%'order by owner"

I get the first column as a bunch of ****** however, all the rest of the columns are correct .. using fwh 8.11

Rick Lipkin

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Generic TxBrowse()
Posted: Tue Jan 27, 2009 05:54 PM

Rick,

We are going to review it to provide you a solution asap, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Generic TxBrowse()
Posted: Wed Jan 28, 2009 01:00 AM
Rick,

As you are getting all other columns correctly, you could:

a) first covert the first column only as character value ( within the query ) and test.

b) if that works, then manually assign picture using the bSetUp parameter of xbrowse function

or try this:
xbrowse( oRs, nil, .t., { |oBrw| MySetUp( oBrw ) } )

function MySetup( oBrw )

 oBrw:aCols[ 1 ]:bEditValue := { || oBrw:oRs:Fields(0):Value }
 oBrw:aCols[ 1 ]:cEditPicture := nil

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Generic TxBrowse()
Posted: Wed Jan 28, 2009 01:26 PM

Antonio

Site_num is the first column that appears correctly .. and all the subsequent columns are correct as well. I will test out your char theory later today and let you know.

Thanks
Rick Lipkin

Continue the discussion