Mr. Rao, refresh a Tree

Mr. Rao, refresh a Tree

Postby Armando » Wed Feb 07, 2024 7:06 pm

Mr. Rao:
could you make a small example to make a Tree from an xBrowse for a fool like me,
allowing to modify a branch and refresh the browse? I have seen several answers
in the forum but none to refresh the browse

Just I have this code:

Code: Select all  Expand view

            REDEFINE XBROWSE oBrw ID 200 OF oDlg;
                DATASOURCE oRsTie;
                COLUMNS "CLI_NOM","TIE_NOM","TIE_NUM";
                HEADERS "Razón Social del Cliente","Nombre de la tienda","Número";
                COLSIZES 250,200,50;
                PICTURES Nil,Nil,"@Z 9999999";
                JUSTIFY {AL_LEFT,AL_LEFT,AL_RIGHT};
                FOOTERS AUTOSORT

                WITH OBJECT oBrw
                    :l2007            := (.F.)
                    :lHScroll         := (.F.)
                    :lVScroll         := (.F.)
                    :nMarqueeStyle    := MARQSTYLE_HIGHLROW
                    :nColDividerStyle := LINESTYLE_LIGHTGRAY
                    :nRowDividerStyle := LINESTYLE_LIGHTGRAY
                    :nStretchCol      := STRETCHCOL_WIDEST
                    :nHeaderHeight      := 25
                    :nRowHeight         := 22
                    :nFooterHeight      := 25
                    :bClrHeader       := { || {CLR_WHITE,CLR_BLACK} }
                    :bClrFooter       := { || {CLR_WHITE,CLR_BLACK} }
                    :bClrSel          := { || IF( oBrw:KeyNo % oApp:nRowsInt == 0 ,{ CLR_BLACK, oApp:nRowParClr },{ CLR_BLACK, oApp:nRowNonClr }) }
                    :bClrSelFocus     := { || {oApp:nFClrFocus,oApp:nBClrFocus} }
                    :bClrStd          := { || IF( oBrw:KeyNo % oApp:nRowsInt == 0 ,{ CLR_BLACK, oApp:nRowParClr },{ CLR_BLACK, oApp:nRowNonClr }) }
                    :nRecSelColor     := oApp:nRowParClr
                    :lDisplayZeros    := (.F.)

               :blDblClick       := { | nRow, nCol, nKey | Editar(oBrw,(.F.))}
               :bKeyDown         := { | nKey, nFlags | IIF(nKey == VK_RETURN,Editar(oBrw,(.F.)),)}

               :SetTree()
               :oTree:OpenAll()

                    WITH OBJECT :aCols[01]
                        :cOrder := "A"
                    END
                END
 



thank you very much
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3061
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Mr. Rao, refresh a Tree

Postby nageswaragunupudi » Thu Feb 08, 2024 9:25 am

Please try this sample and use the logic suitably
Code: Select all  Expand view
#include "fivewin.ch"


function Main()

   local oCn := maria_Connect( "209.250.245.152,fwh,fwhuser,FiveTech@2022" )
   local oRs, cSql
   local oDlg, oBrw, oFont

   FWNumFormat( "A", .t. )
   SetGetColorFocus()


   cSql  := "SELECT STATE,CITY,SALARY FROM customer ORDER BY STATE"
   oRs   := oCn:RowSet( cSql )

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 400,600 PIXEL TRUEPIXEL FONT oFont

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE oRs AUTOCOLS ;
      CELL LINES FOOTERS NOBORDER FASTEDIT

   WITH OBJECT oBrw
      :nStretchCol := 1
      WITH OBJECT :Salary
         :nFooterType   := AGGR_SUM
         :nEditType     := EDIT_GET
      END

      :MakeTotals()
      :SetTree()
      :oTree:OpenAll()

      :lDisplayZeros := .f.
      WITH OBJECT :Salary
         :bEditWhen  := { || oBrw:oTreeItem:oTree == nil }
      END
      :bClrStd := { || { CLR_BLACK, If( oBrw:oTreeItem:oTree == nil, CLR_WHITE, CLR_YELLOW ) } }
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

   oRs:Close()
   oCn:Close()

return nil
Regards

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

Re: Mr. Rao, refresh a Tree

Postby Marc Venken » Thu Feb 08, 2024 9:40 am

Nice, Mr. Rao, could you also change it for a Local DBF please ? I see a option to use this.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Mr. Rao, refresh a Tree

Postby nageswaragunupudi » Thu Feb 08, 2024 3:34 pm

Same logic for any data source
Code: Select all  Expand view
#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local oDlg, oBrw, oFont

   RDDSETDEFAULT( "DBFCDX" )
   FWNumFormat( "A", .t. )
   SetGetColorFocus()

   // By way of caution let is reindex
   FERASE( "CUSTOMER.CDX" )
   USE CUSTOMER EXCLUSIVE
   FW_CdxCreate()
   CLOSE DATA
   //

   USE CUSTOMER SHARED
   SET ORDER TO TAG STATE
   GO TOP

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 400,600 PIXEL TRUEPIXEL FONT oFont

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" ;
      COLUMNS "STATE","CITY","SALARY" ;
      CELL LINES FOOTERS NOBORDER FASTEDIT

   WITH OBJECT oBrw
      :nStretchCol := 1
      WITH OBJECT :Salary
         :nFooterType   := AGGR_SUM
         :nEditType     := EDIT_GET
      END

      :MakeTotals()
      :SetTree()
      :oTree:OpenAll()

      :lDisplayZeros := .f.
      WITH OBJECT :Salary
         :bEditWhen  := { || oBrw:oTreeItem:oTree == nil }
      END
      :bClrStd := { || { CLR_BLACK, If( oBrw:oTreeItem:oTree == nil, CLR_WHITE, CLR_YELLOW ) } }
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

   CLOSE DATA

return nil
Regards

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

Re: Mr. Rao, refresh a Tree

Postby Armando » Fri Feb 09, 2024 12:08 am

Mr. Rao:

the browse recordset has several columns although in the browse I only show three,
the ones necessary to form the tree, and the editing of all the columns is done in a dialog,
I am going to upload a video to better explain my problem, may I?.
For me and my client your support is very important.

With best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3061
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Mr. Rao, refresh a Tree

Postby Armando » Fri Feb 09, 2024 12:42 am

Mr. Rao:

This is my video, it is 18 seconds, if you consider it necessary, I will send you my entire PRG, help me please.

Greetings

https://files.fm/u/u25vv7ebbv
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3061
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Mr. Rao, refresh a Tree

Postby nageswaragunupudi » Fri Feb 09, 2024 12:57 am

We will definitely support you.
I can not see the video but that does not matter.
Are you using FWH builtin Maria/MySql lib?
Also your FWH version.
Regards

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

Re: Mr. Rao, refresh a Tree

Postby nageswaragunupudi » Fri Feb 09, 2024 1:00 am

Also can you connect to our Cloud server
"208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950"
and upload your table there?
Regards

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

Re: Mr. Rao, refresh a Tree

Postby Armando » Fri Feb 09, 2024 1:03 am

Mr. Rao:

Thank you very much in advance

To see the viedo just clic on this link https://files.fm/u/u25vv7ebbv

My Tools.

FWH 2307
MySql 5.1
Harbour &
BCC7

Regards, and thanks again
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3061
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Mr. Rao, refresh a Tree

Postby Armando » Fri Feb 09, 2024 1:11 am

nageswaragunupudi wrote:Also can you connect to our Cloud server
"208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950"
and upload your table there?


Mr. Rao:

Done, you will need 3 tables, Marcas, Modelos and Partes

Best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3061
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Mr. Rao, refresh a Tree

Postby nageswaragunupudi » Fri Feb 09, 2024 2:06 am

To see the viedo just clic on this link https://files.fm/u/u25vv7ebbv

I get the error "the site can not be reached"
Regards

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

Re: Mr. Rao, refresh a Tree

Postby nageswaragunupudi » Fri Feb 09, 2024 2:13 am

Please also give me the SQL to read the data from the 3 tables
Regards

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

Re: Mr. Rao, refresh a Tree

Postby Armando » Fri Feb 09, 2024 2:16 am

Mr. Rao:

May I send the video to your email?, pls give me your a¿email adreess.

Code: Select all  Expand view

   // Record Set de Partes
   oRsPar := FW_OpenRecordSet(oApp:oCon,"SELECT " +;
                                          "*," +;
                                          "MAR_DES," +;
                                          "MOD_DES " +;
                                       "FROM " +;
                                          "Partes " +;
                                       "LEFT JOIN " +;
                                          "Marcas " +;
                                       "ON " +;
                                          "PAR_MAR = MAR_NUM " +;
                                       "LEFT JOIN " +;
                                          "Modelos " +;
                                       "ON " +;
                                          "PAR_MAR = MOD_MAR " +;
                                       "AND " +;
                                          "PAR_MOD = MOD_COD " +;
                                       "ORDER BY " +;
                                          "PAR_MAR,PAR_MOD,PAR_COD",adLockOptimistic,adOpenDynamic,0)

    IF oRsPar:BOF() .AND. oRsPar:EOF()
    ELSE
        oRsPar:MoveFirst()
    ENDIF
 


Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3061
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Mr. Rao, refresh a Tree

Postby nageswaragunupudi » Fri Feb 09, 2024 2:29 am

email:

nageswaragunupudi [at] gmail [dot] com
Regards

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

Re: Mr. Rao, refresh a Tree

Postby Armando » Fri Feb 09, 2024 2:35 am

Mr. rao:

Sent it.

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3061
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Otto and 67 guests