FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse, xBrowser enhansement - Rao
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
xBrowse, xBrowser enhansement - Rao
Posted: Fri Mar 26, 2021 02:56 PM
Rao

I know I have asked Santa for this once before ... I use xBrowse() so many times as a debug tool and many times I have filters involved or Sql where .. and I never know how many records the query fetched .. be it Ado or DbfCdx.

I would be VERY grateful if you could add some code perhaps like this to be able to show how many records were in the recordset of filtered .dbf

Code (fw): Select all Collapse
   oLbxC:lFooter     := .t.
   oCol2             := oLbxC:aCols[ 1 ]
   oCol2:bFooter     := { || Ltrim( Str( oLbxC:KeyNo() ) ) + " / " + LTrim( Str( oLbxC:KeyCount() ) ) }
   oLbxC:bChange     := { || oCol2:RefreshFooter() }


Thanks
Rick Lipkin
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: xBrowse, xBrowser enhansement - Rao
Posted: Fri Mar 26, 2021 03:31 PM

xbrowser(aGroepen) FASTEDIT AUTOSORT SHOW RECID Title "Downloadlijst voor de groepen"

Xbrowse

WITH OBJECT oBrw
:lEditMode := .T.
:lFooter := .t.
:bRecSelHeader := { || "" }
:bRecSelData := { |o| o:KeyNo }
:bRecSelFooter := { |o| o:nLen }
:oRecSelFont := oFont3 // optional
:nRecSelWidth := "99999" // required size
:lHScroll := .F.

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: xBrowse, xBrowser enhansement - Rao
Posted: Fri Mar 26, 2021 04:06 PM
Mark

Thanks for your reply ... I am not creating an xBrowse ( listbox ) ... I am using the function xBrowse() like this ..

Code (fw): Select all Collapse
   cSql := "Select [InvoiceDate],[Invno],[Accno],[Parent1],[ServRend],[TotalBilled],[TotalPaid],[TotalBalDue] From Invoice "
   cSql += "Where [Accno] = '"+cAccno+"' Order by [InvoiceDate]"

   oRsInvoice := TOleAuto():New( "ADODB.Recordset" )
   oRsInvoice:CursorType     := 1        // opendkeyset
   oRsInvoice:CursorLocation := 3        // local cache
   oRsInvoice:LockType       := 3        // lockoportunistic

   TRY
      oRsInvoice:Open( cSQL,xCONNECT )
   CATCH oErr
      MsgInfo( "Error in Opening INVOICE table" )
      oRsSys:CLose()
      RETURN(.F.)
   END TRY

   xbrowse( oRsInvoice )   // <---  here


xBrowse() is part of the Fivwin library and is a quick way to view records either Ado ( sql ) or dbfcdx ... It would be nice to add the number of records within the fetch at the bottom of the listbox.

Thanks
Rick Lipkin
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse, xBrowser enhansement - Rao
Posted: Fri Mar 26, 2021 04:45 PM
Use "SHOW SLNUM" or "SHOW RECID" clauses with XBROWSER command.

XBROWSER has already similar and a lot more capabilties. Please get acquainted with all the capabilities by studying the command translate and also the function in xbrowser.prg.

Using SHOW SLNUM clause.
Code (fw): Select all Collapse
function TestXBrowser()

   local oCn, oRs

   FWNumFormat( "A", .T. )

   oCn   := FW_OpenAdoConnection( "xbrtest.mdb" )
   oRs   := FW_OpenRecordSet( oCn, "select * from customer order by first" )

   XBROWSER oRs COLUMNS "FIRST","CITY","STATE", "SALARY" FASTEDIT ;
      SHOW SLNUM  // or RECID

   oRs:Close()
   oCn:Close()

return nil


Regards



G. N. Rao.

Hyderabad, India

Continue the discussion