xBrowse, xBrowser enhansement - Rao

xBrowse, xBrowser enhansement - Rao

Postby Rick Lipkin » Fri Mar 26, 2021 2: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: Select all  Expand view

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

 


Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2662
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xBrowse, xBrowser enhansement - Rao

Postby Marc Venken » Fri Mar 26, 2021 3: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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1417
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: xBrowse, xBrowser enhansement - Rao

Postby Rick Lipkin » Fri Mar 26, 2021 4:06 pm

Mark

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

Code: Select all  Expand view

   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
User avatar
Rick Lipkin
 
Posts: 2662
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xBrowse, xBrowser enhansement - Rao

Postby nageswaragunupudi » Fri Mar 26, 2021 4: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: Select all  Expand view
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
 


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10595
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 42 guests