xbrowse features

xbrowse features

Postby Silvio.Falconi » Mon May 01, 2017 9:56 am

I can group the data of a stored archive into an xbrowse by pressing a button and do it online (from the end user) for example by taking the customer.dbf archive I could group the archive by state, city, and show partial totals
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse features

Postby nageswaragunupudi » Mon May 01, 2017 10:03 am

I think I posted a few samples like this. Please search
Regards

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

Re: xbrowse features

Postby Silvio.Falconi » Mon May 01, 2017 10:06 am

ok Now I remember there was somthing
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse features

Postby Silvio.Falconi » Mon May 01, 2017 7:29 pm

Nages,
I found it ( your sample) but I wish it on line from symply to tree and viceversa
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse features

Postby Silvio.Falconi » Mon May 01, 2017 8:43 pm

I found this but it init from tree

I wish show the customers normally and then if if the final user press a button make the group
the final user can select the type of groups for eah field he wants ( or the field I can set as selection)


Code: Select all  Expand view

#include "FiveWin.Ch"
#include "ord.ch"
#include "xbrowse.ch"

//----------------------------------------------------------------------------//

REQUEST DBFCDX

static cFwhPath   := "c:\work\fwh\"

//----------------------------------------------------------------------------//

function Main()

   BrowseTree( MakeTree() )

return (0)

//----------------------------------------------------------------------------//

init procedure PrgInit

   SET DATE ITALIAN
   SET CENTURY ON
   SET TIME FORMAT TO "
HH:MM:SS"
   SET EPOCH TO YEAR(DATE())-50

   SET DELETED ON
   SET EXCLUSIVE OFF

   RDDSETDEFAULT( "
DBFCDX" )

   XbrNumFormat( 'E', .t. )
   SetKinetic( .f. )
   SetGetColorFocus()
   SetBalloon( .t. )

return

//----------------------------------------------------------------------------//

static function MakeTree()

   field STATE,CODE,CITY

   local cPath    := cFwhPath + "
samples\\"
   local oTree, oState, oCity

   USE ( cPath + "
STATES" ) NEW SHARED
   INDEX ON CODE TAG CODE TO STMP MEMORY
   USE ( cPath + "
CUSTOMER" ) NEW ALIAS CUST SHARED
   INDEX ON STATE+CITY TAG STATE TO CTMP MEMORY
   SET RELATION TO STATE INTO STATES
   GO TOP

   TREE oTree
   oTree:Cargo    := { "
", 0, 0.00, 0 }
   do while ! CUST->( eof() )
      TREEITEM oState PROMPT STATES->NAME CARGO { CTOD( "
" ), 0, 0.00, 0 }
      TREE
         do while STATES->NAME == oState:cPrompt .and. ! CUST->( eof() )
            TREEITEM oCity PROMPT CUST->CITY ;
               CARGO { CUST->HIREDATE, CUST->AGE, CUST->SALARY, CUST->( RECNO() ) }
            oState:Cargo[ 2 ]    += oCity:Cargo[ 2 ]
            oState:Cargo[ 3 ]    += oCity:Cargo[ 3 ]
            CUST->( DbSkip( 1 ) )
         enddo
         TREEITEM "
Sub-Total" CARGO oState:Cargo
         oTree:Cargo[ 2 ]  += oState:Cargo[ 2 ]
         oTree:Cargo[ 3 ]  += oState:Cargo[ 3 ]
      ENDTREE

   enddo
   ENDTREE

return oTree

//----------------------------------------------------------------------------//

static function BrowseTree( oTree )

   local oDlg, oBrw, oFont
   local nGrpClr     := RGB(255,250,220)
   local nTotClr     := RGB(200,255,200)

   DEFINE FONT oFont NAME "
TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 620,700 PIXEL FONT oFont ;
      TITLE "
EDITABLE TREE BROWSE WITH SUBTOTALS"

   @ 20,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg DATASOURCE oTree ;
      COLUMNS 1, 2, 3 ;
      HEADERS "
State/City", "HireDate", "Number", "Salary" ;
      PICTURES nil, nil, nil, NumPict ( 12, 2 ) ;
      CELL LINES FOOTERS FASTEDIT NOBORDER

   WITH OBJECT oBrw
      :nStretchCol         := 1
      :lDisplayZeros       := .f.
      :bChange             := { || CUST->( DBGOTO( oBrw:oTreeItem:Cargo[ 4 ] ) ) }
      :bLock               := { || CUST->( RLOCK() ) }
      :bUnLock             := { || CUST->( DBUNLOCK() ) }

      :bClrStd             := { || { CLR_BLACK, If( oBrw:oTreeItem:nLevel == 1, nGrpClr, ;
                                                If( oBrw:oTreeItem:cPrompt == "
Sub-Total", nTotClr, ;
                                                CLR_WHITE ) ) } }
      // Bitmaps
      WITH OBJECT :aCols[ 1 ]
         :AddBitmap( {  FWRArrow(), FWDArrow(), cFwhPath + "
bitmaps\16x16\reset.bmp" } )
         :cFooter          := "
GRAND TOTAL"
      END
      // When Group is closed show totals. When open show totals at bottom
      // Allow edit of columns and save data to DBF, update group and grand totals
      WITH OBJECT :aCols[ 3 ]
         :bEditValue       := { |x| If( oBrw:oTreeItem:lOpened, 0, ;
                                    If( x == nil, oBrw:oTreeItem:Cargo[ 2 ], ;
                                    CUST->AGE := oBrw:oTreeItem:Cargo[ 2 ] := x ) ) }
         :nTotal           := oTree:Cargo[ 2 ]
         //
         :nEditType        := EDIT_GET
         :bEditWhen        := { || oBrw:oTreeItem:nLevel > 1 .and. oBrw:oTreeItem:cPrompt != "
Sub-Total" }
         :bOnChange        := { |o,nOld| oBrw:oTreeItem:Parent():Cargo[ 2 ] += ( o:Value - nOld ), oBrw:Refresh() }
      END
      WITH OBJECT :aCols[ 4 ]
         :bEditValue       := { |x| If( oBrw:oTreeItem:lOpened, 0, ;
                                    If( x == nil, oBrw:oTreeItem:Cargo[ 3 ], ;
                                    CUST->SALARY := oBrw:oTreeItem:Cargo[ 3 ] := x ) ) }
         :nTotal           := oTree:Cargo[ 3 ]
         //
         :nEditType        := EDIT_GET
         :bEditWhen        := { || oBrw:oTreeItem:nLevel > 1 .and. oBrw:oTreeItem:cPrompt != "
Sub-Total" }
         :bOnChange        := { |o,nOld| oBrw:oTreeItem:Parent():Cargo[ 3 ] += ( o:Value - nOld ), oBrw:Refresh() }
      END
      //
      :CreateFromCode()
   END

   Eval( oBrw:bChange )

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil

//----------------------------------------------------------------------------//





But this sample I see a group of states ok
but for each state I wish show from first column of Browse
Fist,Last,street,city,zip
and order for first


I mean as this
Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi and 92 guests