Generic TxBrowse()

Generic TxBrowse()

Postby Rick Lipkin » Tue Jan 27, 2009 1: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Generic TxBrowse()

Postby Antonio Linares » Tue Jan 27, 2009 2: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Generic TxBrowse()

Postby Rick Lipkin » Tue Jan 27, 2009 2: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Generic TxBrowse()

Postby Antonio Linares » Tue Jan 27, 2009 5:54 pm

Rick,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Generic TxBrowse()

Postby Antonio Linares » Wed Jan 28, 2009 1: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:
Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Generic TxBrowse()

Postby Rick Lipkin » Wed Jan 28, 2009 1: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to To do - WishList / Por hacer - Peticiones

Who is online

Users browsing this forum: No registered users and 6 guests