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
Generic TxBrowse()
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Generic TxBrowse()
Rick,
This is available since FWH 8.07:
FWH\samples\TestXbr3.prg
This is available since FWH 8.07:
In FWH 8.08 it was enhanced: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.
There is a working example in: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.
FWH\samples\TestXbr3.prg
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: Generic TxBrowse()
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
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
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Generic TxBrowse()
Rick,
We are going to review it to provide you a solution asap, thanks
We are going to review it to provide you a solution asap, thanks
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Generic TxBrowse()
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:
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
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
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: Generic TxBrowse()
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
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