Creation an array Multiple on Horizontal on Xbrowse - RESOLV

Creation an array Multiple on Horizontal on Xbrowse - RESOLV

Postby Silvio.Falconi » Mon Sep 26, 2022 9:00 am

I would like to create a horizontal array that is, I'll explain
for an extraction I create an array like this

Image

Code: Select all  Expand view


   static function  Build_Array(oDbf,nRecord,oBrw)
   local aTemp:= {}
   local aRuote  := {"Bari","Cagliari","Firenze","Genova",;
                   "Milano","Napoli","Palermo","Roma","Torino",;
                   "Venezia","Nazionale"}

   local cTitle:= oDbf:data

  IF !oDbf:eof()
    oDbf:goto(nRecord)
    AaDd(aTemp,{ aRuote[1],   oDbf:ba1,oDbf:ba2,oDbf:ba3,oDbf:ba4,oDbf:ba5})
    AaDd(aTemp,{ aRuote[2],   oDbf:ca1,oDbf:ca2,oDbf:ca3,oDbf:ca4,oDbf:ca5 })
    AaDd(aTemp,{ aRuote[3],   oDbf:fi1,oDbf:fi2,oDbf:fi3,oDbf:fi4,oDbf:fi5 })
    AaDd(aTemp,{ aRuote[4],   oDbf:ge1,oDbf:ge2,oDbf:ge3,oDbf:ge4,oDbf:ge5 })
    AaDd(aTemp,{ aRuote[5],   oDbf:mi1,oDbf:mi2,oDbf:mi3,oDbf:mi4,oDbf:mi5 })
    AaDd(aTemp,{ aRuote[6],   oDbf:na1,oDbf:na2,oDbf:na3,oDbf:na4,oDbf:na5 })
    AaDd(aTemp,{ aRuote[7],   oDbf:pa1,oDbf:pa2,oDbf:pa3,oDbf:pa4,oDbf:pa5 })
    AaDd(aTemp,{ aRuote[8],   oDbf:rm1,oDbf:rm2,oDbf:rm3,oDbf:rm4,oDbf:rm5 })
    AaDd(aTemp,{ aRuote[9],   oDbf:to1,oDbf:to2,oDbf:to3,oDbf:to4,oDbf:to5 })
    AaDd(aTemp,{ aRuote[10],  oDbf:ve1,oDbf:ve2,oDbf:ve3,oDbf:ve4,oDbf:ve5 })
    AaDd(aTemp,{ aRuote[11],  oDbf:nz1,oDbf:nz2,oDbf:nz3,oDbf:nz4,oDbf:na5 })
    oBrw:setarray(aTemp)
 AEval( oBrw:aCols, { |o| o:cGrpHdr := cf(cTitle)   }, 2, 6 )
 Endif
RETURN NIL
 


and having as group header the data of the extraction

now I would like to create a hypothetically infinite array like this, command by final user (until 10 records)
( I draw it)

Image

obviously changing the dates for each record


How I can make it , any help pls
Last edited by Silvio.Falconi on Wed Sep 28, 2022 7:22 am, edited 1 time in total.
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Creation an array Multiple on Horizontal on Xbrowse

Postby Antonio Linares » Tue Sep 27, 2022 9:21 am

Do you mean that each group browses a different array ??
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Creation an array Multiple on Horizontal on Xbrowse

Postby Silvio.Falconi » Tue Sep 27, 2022 9:54 am

Antonio Linares wrote:Do you mean that each group browses a different array ??


No they must be displayed vertically in the same way as I created the first one



AaDd(aTemp,{ aRuote[1], oDbf:ba1,oDbf:ba2,oDbf:ba3,oDbf:ba4,oDbf:ba5 })




for example for the first line the first column remains unchanged (name of the wheel) at the end of odbf: Ba5 the procedure must select the new record and restart from oDbf: ba1

aRuote[1], oDbf:ba1,oDbf:ba2,oDbf:ba3,oDbf:ba4,oDbf:ba5 SKIP RECORD Dbf:ba1,oDbf:ba2,oDbf:ba3,oDbf:ba4,oDbf:ba5 SKIP RECORD Dbf:ba1,oDbf:ba2,oDbf:ba3,oDbf:ba4,oDbf:ba5
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Creation an array Multiple on Horizontal on Xbrowse

Postby cmsoft » Tue Sep 27, 2022 12:17 pm

Silvio, creo que debería ser así:
Yo lo hago con MySql, pero creo que haciendolo con dbf no debería ser muy distinto
Code: Select all  Expand view

#include "fivewin.ch"
function Main()

   local oQry, oCn, aArray := {}
   local cServer := 'localhost', cUser := 'root', cPassword := 'secret', cDBName := 'test', nPort := "3306"
   local oDlg,  oBrw
   FWCONNECT oCn HOST cServer USER cUser PASSWORD cPassword DATABASE cDBName PORT VAL(nPort)
   oQry := oCn:Query("SELECT * FROM silvio ORDER BY data ")

   DEFINE DIALOG oDlg SIZE 980,300 PIXEL ;
      TITLE "INFINITE XBROWSE"
   aArray := Build_Array(oQry)
   @ 30,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      ARRAY aArray AUTOCOLS  ;
      CELL LINES FOOTERS NOBORDER
   
   WITH OBJECT oBrw
      :CreateFromCode()
   END
   oBrw:aCols[1]:cHeader := "Ruote"
   Build_Title(oQry,oBrw)  
   ACTIVATE DIALOG oDlg CENTERED

return NIL  

static function  Build_Array(oDbf)
   local aTemp:= {}, i, nIni
   local aRuote  := {"Bari","Cagliari","Firenze","Genova",;
                   "Milano","Napoli","Palermo","Roma","Torino",;
                   "Venezia","Nazionale"}

   local cTitle
  FOR i:= 1 TO 11
      AaDd(aTemp, {aRuote[i]})
  NEXT i  
  oDbf:GoTop()  
  do while !oDbf:Eof
    AaDd(aTemp[1],oDbf:ba1)
    AaDd(aTemp[1],oDbf:ba2)
    AaDd(aTemp[1],oDbf:ba3)
    AaDd(aTemp[1],oDbf:ba4)
    AaDd(aTemp[1],oDbf:ba5)
    AaDd(aTemp[2],oDbf:ca1)
    AaDd(aTemp[2],oDbf:ca2)
    AaDd(aTemp[2],oDbf:ca3)
    AaDd(aTemp[2],oDbf:ca4)
    AaDd(aTemp[2],oDbf:ca5)
    AaDd(aTemp[3],oDbf:fi1)
    AaDd(aTemp[3],oDbf:fi2)
    AaDd(aTemp[3],oDbf:fi3)
    AaDd(aTemp[3],oDbf:fi4)
    AaDd(aTemp[3],oDbf:fi5)
    AaDd(aTemp[4],oDbf:ge1)
    AaDd(aTemp[4],oDbf:ge2)
    AaDd(aTemp[4],oDbf:ge3)
    AaDd(aTemp[4],oDbf:ge4)
    AaDd(aTemp[4],oDbf:ge5)
    AaDd(aTemp[5],oDbf:mi1)
    AaDd(aTemp[5],oDbf:mi2)
    AaDd(aTemp[5],oDbf:mi3)
    AaDd(aTemp[5],oDbf:mi4)
    AaDd(aTemp[5],oDbf:mi5)    
    AaDd(aTemp[6],oDbf:na1)
    AaDd(aTemp[6],oDbf:na2)
    AaDd(aTemp[6],oDbf:na3)
    AaDd(aTemp[6],oDbf:na4)
    AaDd(aTemp[6],oDbf:na5)    
    AaDd(aTemp[7],oDbf:pa1)
    AaDd(aTemp[7],oDbf:pa2)
    AaDd(aTemp[7],oDbf:pa3)
    AaDd(aTemp[7],oDbf:pa4)
    AaDd(aTemp[7],oDbf:pa5)    
    AaDd(aTemp[8],oDbf:rm1)
    AaDd(aTemp[8],oDbf:rm2)
    AaDd(aTemp[8],oDbf:rm3)
    AaDd(aTemp[8],oDbf:rm4)
    AaDd(aTemp[8],oDbf:rm5)
    AaDd(aTemp[9],oDbf:to1)
    AaDd(aTemp[9],oDbf:to2)
    AaDd(aTemp[9],oDbf:to3)
    AaDd(aTemp[9],oDbf:to4)
    AaDd(aTemp[9],oDbf:to5)
    AaDd(aTemp[10],oDbf:ve1)
    AaDd(aTemp[10],oDbf:ve2)
    AaDd(aTemp[10],oDbf:ve3)
    AaDd(aTemp[10],oDbf:ve4)
    AaDd(aTemp[10],oDbf:ve5)
    AaDd(aTemp[11],oDbf:nz1)
    AaDd(aTemp[11],oDbf:nz2)
    AaDd(aTemp[11],oDbf:nz3)
    AaDd(aTemp[11],oDbf:nz4)
    AaDd(aTemp[11],oDbf:nz5)                
    oDbf:Skip()        
  enddo  
   
  //oBrw:setarray(aTemp)
 
RETURN aTemp

static function  Build_Title(oDbf,oBrw)
   local nIni := 2    
   local cTitle
   oDbf:GoTop()
  do while !oDbf:Eof
    oBrw:aCols[nIni]:cHeader := "A"
    oBrw:aCols[nIni+1]:cHeader := "B"
    oBrw:aCols[nIni+2]:cHeader := "C"
    oBrw:aCols[nIni+3]:cHeader := "D"
    oBrw:aCols[nIni+4]:cHeader := "E"
    cTitle:= dtoc(oDbf:data)
    oBrw:SetGroupHeader( cTitle, nIni, nIni+4 )
    oDbf:Skip()        
    nIni := nIni +5
  enddo  
RETURN NIL
 

Espero te sirva
User avatar
cmsoft
 
Posts: 1290
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Creation an array Multiple on Horizontal on Xbrowse

Postby Silvio.Falconi » Tue Sep 27, 2022 8:15 pm

cmsoft wrote:Silvio, creo que debería ser así:
Yo lo hago con MySql, pero creo que haciendolo con dbf no debería ser muy distinto
Code: Select all  Expand view

#include "fivewin.ch"
function Main()

   local oQry, oCn, aArray := {}
   local cServer := 'localhost', cUser := 'root', cPassword := 'secret', cDBName := 'test', nPort := "3306"
   local oDlg,  oBrw
   FWCONNECT oCn HOST cServer USER cUser PASSWORD cPassword DATABASE cDBName PORT VAL(nPort)
   oQry := oCn:Query("SELECT * FROM silvio ORDER BY data ")

   DEFINE DIALOG oDlg SIZE 980,300 PIXEL ;
      TITLE "INFINITE XBROWSE"
   aArray := Build_Array(oQry)
   @ 30,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      ARRAY aArray AUTOCOLS  ;
      CELL LINES FOOTERS NOBORDER
   
   WITH OBJECT oBrw
      :CreateFromCode()
   END
   oBrw:aCols[1]:cHeader := "Ruote"
   Build_Title(oQry,oBrw)  
   ACTIVATE DIALOG oDlg CENTERED

return NIL  

static function  Build_Array(oDbf)
   local aTemp:= {}, i, nIni
   local aRuote  := {"Bari","Cagliari","Firenze","Genova",;
                   "Milano","Napoli","Palermo","Roma","Torino",;
                   "Venezia","Nazionale"}

   local cTitle
  FOR i:= 1 TO 11
      AaDd(aTemp, {aRuote[i]})
  NEXT i  
  oDbf:GoTop()  
  do while !oDbf:Eof
    AaDd(aTemp[1],oDbf:ba1)
    AaDd(aTemp[1],oDbf:ba2)
    AaDd(aTemp[1],oDbf:ba3)
    AaDd(aTemp[1],oDbf:ba4)
    AaDd(aTemp[1],oDbf:ba5)
    AaDd(aTemp[2],oDbf:ca1)
    AaDd(aTemp[2],oDbf:ca2)
    AaDd(aTemp[2],oDbf:ca3)
    AaDd(aTemp[2],oDbf:ca4)
    AaDd(aTemp[2],oDbf:ca5)
    AaDd(aTemp[3],oDbf:fi1)
    AaDd(aTemp[3],oDbf:fi2)
    AaDd(aTemp[3],oDbf:fi3)
    AaDd(aTemp[3],oDbf:fi4)
    AaDd(aTemp[3],oDbf:fi5)
    AaDd(aTemp[4],oDbf:ge1)
    AaDd(aTemp[4],oDbf:ge2)
    AaDd(aTemp[4],oDbf:ge3)
    AaDd(aTemp[4],oDbf:ge4)
    AaDd(aTemp[4],oDbf:ge5)
    AaDd(aTemp[5],oDbf:mi1)
    AaDd(aTemp[5],oDbf:mi2)
    AaDd(aTemp[5],oDbf:mi3)
    AaDd(aTemp[5],oDbf:mi4)
    AaDd(aTemp[5],oDbf:mi5)    
    AaDd(aTemp[6],oDbf:na1)
    AaDd(aTemp[6],oDbf:na2)
    AaDd(aTemp[6],oDbf:na3)
    AaDd(aTemp[6],oDbf:na4)
    AaDd(aTemp[6],oDbf:na5)    
    AaDd(aTemp[7],oDbf:pa1)
    AaDd(aTemp[7],oDbf:pa2)
    AaDd(aTemp[7],oDbf:pa3)
    AaDd(aTemp[7],oDbf:pa4)
    AaDd(aTemp[7],oDbf:pa5)    
    AaDd(aTemp[8],oDbf:rm1)
    AaDd(aTemp[8],oDbf:rm2)
    AaDd(aTemp[8],oDbf:rm3)
    AaDd(aTemp[8],oDbf:rm4)
    AaDd(aTemp[8],oDbf:rm5)
    AaDd(aTemp[9],oDbf:to1)
    AaDd(aTemp[9],oDbf:to2)
    AaDd(aTemp[9],oDbf:to3)
    AaDd(aTemp[9],oDbf:to4)
    AaDd(aTemp[9],oDbf:to5)
    AaDd(aTemp[10],oDbf:ve1)
    AaDd(aTemp[10],oDbf:ve2)
    AaDd(aTemp[10],oDbf:ve3)
    AaDd(aTemp[10],oDbf:ve4)
    AaDd(aTemp[10],oDbf:ve5)
    AaDd(aTemp[11],oDbf:nz1)
    AaDd(aTemp[11],oDbf:nz2)
    AaDd(aTemp[11],oDbf:nz3)
    AaDd(aTemp[11],oDbf:nz4)
    AaDd(aTemp[11],oDbf:nz5)                
    oDbf:Skip()        
  enddo  
   
  //oBrw:setarray(aTemp)
 
RETURN aTemp

static function  Build_Title(oDbf,oBrw)
   local nIni := 2    
   local cTitle
   oDbf:GoTop()
  do while !oDbf:Eof
    oBrw:aCols[nIni]:cHeader := "A"
    oBrw:aCols[nIni+1]:cHeader := "B"
    oBrw:aCols[nIni+2]:cHeader := "C"
    oBrw:aCols[nIni+3]:cHeader := "D"
    oBrw:aCols[nIni+4]:cHeader := "E"
    cTitle:= dtoc(oDbf:data)
    oBrw:SetGroupHeader( cTitle, nIni, nIni+4 )
    oDbf:Skip()        
    nIni := nIni +5
  enddo  
RETURN NIL
 

Espero te sirva



I tested the your test but not see the array

Image

I add a variable ( nRecords) because I wish show 10,20,30,50,100,200,300,500 records but this is selected by final user and the user want select also the year
to test I try with 10 records

for a sample : the last 10 records of 2022 year

If not insert this the xbrowse is infinite and the records now are 10136

I use tdatabase
Code: Select all  Expand view

#include "fivewin.ch"


function Main()

   local oQry, oCn, aArray := {}
  * local cServer := 'localhost', cUser := 'root', cPassword := 'secret', cDBName := 'test', nPort := "3306"
   local oDlg,  oBrw
  * FWCONNECT oCn HOST cServer USER cUser PASSWORD cPassword DATABASE cDBName PORT VAL(nPort)
  * oQry := oCn:Query("SELECT * FROM silvio ORDER BY data ")
    local cdbfPath :=".\data\"
    oQry := TDatabase():Open( , cdbfPath+"
LOTTO", "DBFCDX", .T. )
    oQry:setorder(1)  //data


   DEFINE DIALOG oDlg SIZE 980,300 PIXEL ;
      TITLE "
INFINITE XBROWSE"

   aArray := Build_Array(oQry)

   @ 30,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      ARRAY aArray AUTOCOLS  ;
      CELL LINES FOOTERS NOBORDER

   WITH OBJECT oBrw
      :CreateFromCode()
   END

   oBrw:aCols[1]:cHeader := "
Ruote"

   Build_Title(oQry,oBrw)

   ACTIVATE DIALOG oDlg CENTERED

return NIL

static function  Build_Array(oDbf)
   local aTemp:= {}, i, nIni
   local aRuote  := {"
Bari","Cagliari","Firenze","Genova",;
                   "
Milano","Napoli","Palermo","Roma","Torino",;
                   "
Venezia","Nazionale"}

   local cTitle
   local nrecords:= 0

  FOR i:= 1 TO 11
      AaDd(aTemp, {aRuote[i]})
  NEXT i  
  oDbf:GoTop()


  do while !oDbf:Eof  .and. nrecords = 10
    AaDd(aTemp[1],oDbf:ba1)
    AaDd(aTemp[1],oDbf:ba2)
    AaDd(aTemp[1],oDbf:ba3)
    AaDd(aTemp[1],oDbf:ba4)
    AaDd(aTemp[1],oDbf:ba5)
    AaDd(aTemp[2],oDbf:ca1)
    AaDd(aTemp[2],oDbf:ca2)
    AaDd(aTemp[2],oDbf:ca3)
    AaDd(aTemp[2],oDbf:ca4)
    AaDd(aTemp[2],oDbf:ca5)
    AaDd(aTemp[3],oDbf:fi1)
    AaDd(aTemp[3],oDbf:fi2)
    AaDd(aTemp[3],oDbf:fi3)
    AaDd(aTemp[3],oDbf:fi4)
    AaDd(aTemp[3],oDbf:fi5)
    AaDd(aTemp[4],oDbf:ge1)
    AaDd(aTemp[4],oDbf:ge2)
    AaDd(aTemp[4],oDbf:ge3)
    AaDd(aTemp[4],oDbf:ge4)
    AaDd(aTemp[4],oDbf:ge5)
    AaDd(aTemp[5],oDbf:mi1)
    AaDd(aTemp[5],oDbf:mi2)
    AaDd(aTemp[5],oDbf:mi3)
    AaDd(aTemp[5],oDbf:mi4)
    AaDd(aTemp[5],oDbf:mi5)
    AaDd(aTemp[6],oDbf:na1)
    AaDd(aTemp[6],oDbf:na2)
    AaDd(aTemp[6],oDbf:na3)
    AaDd(aTemp[6],oDbf:na4)
    AaDd(aTemp[6],oDbf:na5)
    AaDd(aTemp[7],oDbf:pa1)
    AaDd(aTemp[7],oDbf:pa2)
    AaDd(aTemp[7],oDbf:pa3)
    AaDd(aTemp[7],oDbf:pa4)
    AaDd(aTemp[7],oDbf:pa5)    
    AaDd(aTemp[8],oDbf:rm1)
    AaDd(aTemp[8],oDbf:rm2)
    AaDd(aTemp[8],oDbf:rm3)
    AaDd(aTemp[8],oDbf:rm4)
    AaDd(aTemp[8],oDbf:rm5)
    AaDd(aTemp[9],oDbf:to1)
    AaDd(aTemp[9],oDbf:to2)
    AaDd(aTemp[9],oDbf:to3)
    AaDd(aTemp[9],oDbf:to4)
    AaDd(aTemp[9],oDbf:to5)
    AaDd(aTemp[10],oDbf:ve1)
    AaDd(aTemp[10],oDbf:ve2)
    AaDd(aTemp[10],oDbf:ve3)
    AaDd(aTemp[10],oDbf:ve4)
    AaDd(aTemp[10],oDbf:ve5)
    AaDd(aTemp[11],oDbf:nz1)
    AaDd(aTemp[11],oDbf:nz2)
    AaDd(aTemp[11],oDbf:nz3)
    AaDd(aTemp[11],oDbf:nz4)
    AaDd(aTemp[11],oDbf:nz5)
    oDbf:Skip()
    nrecords++
  enddo

  //oBrw:setarray(aTemp)
 
RETURN aTemp

static function  Build_Title(oDbf,oBrw)
   local nIni := 2    
   local cTitle
   local nrecords:= 0
   oDbf:GoTop()
  do while !oDbf:Eof    .and. nrecords = 10
    oBrw:aCols[nIni]:cHeader := "
A"
    oBrw:aCols[nIni+1]:cHeader := "
B"
    oBrw:aCols[nIni+2]:cHeader := "
C"
    oBrw:aCols[nIni+3]:cHeader := "
D"
    oBrw:aCols[nIni+4]:cHeader := "
E"
    cTitle:= dtoc(oDbf:data)
    oBrw:SetGroupHeader( cTitle, nIni, nIni+4 )
    oDbf:Skip()
     nrecords++
    nIni := nIni +5
  enddo  
RETURN NIL
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Creation an array Multiple on Horizontal on Xbrowse

Postby Silvio.Falconi » Tue Sep 27, 2022 8:38 pm

Now I make another test
filter on only 2022 year and I have this result


Image

Code: Select all  Expand view

#include "fivewin.ch"


function Main()

   local oQry, oCn, aArray := {}
  * local cServer := 'localhost', cUser := 'root', cPassword := 'secret', cDBName := 'test', nPort := "3306"
   local oDlg,  oBrw
  * FWCONNECT oCn HOST cServer USER cUser PASSWORD cPassword DATABASE cDBName PORT VAL(nPort)
  * oQry := oCn:Query("SELECT * FROM silvio ORDER BY data ")
    local cdbfPath :=".\data\"
    local nyear:="
2022"
    local cfilter

    oQry := TDatabase():Open( , cdbfPath+"
LOTTO", "DBFCDX", .T. )
    oQry:setorder(1)  //data


     cFilter:= "
LTRIM(STR(YEAR(FIELD->DATA)))= '" + nyear + "'"
        oQry:SetFilter(cFilter)
        oQry:GoTop()



   DEFINE DIALOG oDlg SIZE 980,400 PIXEL ;
      TITLE "
INFINITE XBROWSE"

   aArray := Build_Array(oQry)


   @ 30,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      ARRAY aArray AUTOCOLS  ;
      CELL LINES FOOTERS NOBORDER

   WITH OBJECT oBrw

                      :nRowHeight    := 30
                      :nClrBorder := CLR_GRAY
                      :nMarqueeStyle       := MARQSTYLE_HIGHLROWMS
                      :lHscroll            := .t.
                      :l2007               := .F.
                      :l2015               := .T.
                     // :nStretchCol         := STRETCHCOL_WIDEST
                      :lAllowRowSizing     := .F.
                      :lAllowColSwapping   := .F.
                      :lAllowColHiding     := .F.
                      :lRecordSelector     := .F.
                      :nColDividerStyle    := LINESTYLE_LIGHTGRAY
                      :nRowDividerStyle    := LINESTYLE_LIGHTGRAY



      FOR i := 2 TO LEN(:aCols)
         oCol := :aCols[ i ]
         oCol:nWidth   := 17
      NEXT

     :CreateFromCode()
   END
   oBrw:aCols[1]:cHeader := "
Ruote"

   Build_Title(oQry,oBrw)

   ACTIVATE DIALOG oDlg CENTERED

return NIL

static function  Build_Array(oDbf)
   local aTemp:= {}, i, nIni
   local aRuote  := {"
Bari","Cagliari","Firenze","Genova",;
                   "
Milano","Napoli","Palermo","Roma","Torino",;
                   "
Venezia","Nazionale"}

   local cTitle


  FOR i:= 1 TO 11
      AaDd(aTemp, {aRuote[i]})
  NEXT i
  oDbf:GoTop()


  do while !oDbf:Eof
    AaDd(aTemp[1],oDbf:ba1)
    AaDd(aTemp[1],oDbf:ba2)
    AaDd(aTemp[1],oDbf:ba3)
    AaDd(aTemp[1],oDbf:ba4)
    AaDd(aTemp[1],oDbf:ba5)
    AaDd(aTemp[2],oDbf:ca1)
    AaDd(aTemp[2],oDbf:ca2)
    AaDd(aTemp[2],oDbf:ca3)
    AaDd(aTemp[2],oDbf:ca4)
    AaDd(aTemp[2],oDbf:ca5)
    AaDd(aTemp[3],oDbf:fi1)
    AaDd(aTemp[3],oDbf:fi2)
    AaDd(aTemp[3],oDbf:fi3)
    AaDd(aTemp[3],oDbf:fi4)
    AaDd(aTemp[3],oDbf:fi5)
    AaDd(aTemp[4],oDbf:ge1)
    AaDd(aTemp[4],oDbf:ge2)
    AaDd(aTemp[4],oDbf:ge3)
    AaDd(aTemp[4],oDbf:ge4)
    AaDd(aTemp[4],oDbf:ge5)
    AaDd(aTemp[5],oDbf:mi1)
    AaDd(aTemp[5],oDbf:mi2)
    AaDd(aTemp[5],oDbf:mi3)
    AaDd(aTemp[5],oDbf:mi4)
    AaDd(aTemp[5],oDbf:mi5)
    AaDd(aTemp[6],oDbf:na1)
    AaDd(aTemp[6],oDbf:na2)
    AaDd(aTemp[6],oDbf:na3)
    AaDd(aTemp[6],oDbf:na4)
    AaDd(aTemp[6],oDbf:na5)
    AaDd(aTemp[7],oDbf:pa1)
    AaDd(aTemp[7],oDbf:pa2)
    AaDd(aTemp[7],oDbf:pa3)
    AaDd(aTemp[7],oDbf:pa4)
    AaDd(aTemp[7],oDbf:pa5)
    AaDd(aTemp[8],oDbf:rm1)
    AaDd(aTemp[8],oDbf:rm2)
    AaDd(aTemp[8],oDbf:rm3)
    AaDd(aTemp[8],oDbf:rm4)
    AaDd(aTemp[8],oDbf:rm5)
    AaDd(aTemp[9],oDbf:to1)
    AaDd(aTemp[9],oDbf:to2)
    AaDd(aTemp[9],oDbf:to3)
    AaDd(aTemp[9],oDbf:to4)
    AaDd(aTemp[9],oDbf:to5)
    AaDd(aTemp[10],oDbf:ve1)
    AaDd(aTemp[10],oDbf:ve2)
    AaDd(aTemp[10],oDbf:ve3)
    AaDd(aTemp[10],oDbf:ve4)
    AaDd(aTemp[10],oDbf:ve5)
    AaDd(aTemp[11],oDbf:nz1)
    AaDd(aTemp[11],oDbf:nz2)
    AaDd(aTemp[11],oDbf:nz3)
    AaDd(aTemp[11],oDbf:nz4)
    AaDd(aTemp[11],oDbf:nz5)
    oDbf:Skip()
  enddo

  //oBrw:setarray(aTemp)

RETURN aTemp
//-----------------------------------------------------------//
static function  Build_Title(oDbf,oBrw)
   local nIni := 2    
   local cTitle

   oDbf:GoTop()
  do while !oDbf:Eof
    oBrw:aCols[nIni]:cHeader := "
1"
    oBrw:aCols[nIni+1]:cHeader := "
2"
    oBrw:aCols[nIni+2]:cHeader := "
3"
    oBrw:aCols[nIni+3]:cHeader := "
4"
    oBrw:aCols[nIni+4]:cHeader := "
5"
    cTitle:= dtoc(oDbf:data)
    oBrw:SetGroupHeader( cTitle, nIni, nIni+4 )
    oDbf:Skip()

    nIni := nIni +5
  enddo  
RETURN NIL



Thanks Mr Cesar Gomez now run ok

Image
Last edited by Silvio.Falconi on Tue Sep 27, 2022 8:54 pm, edited 4 times in total.
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Creation an array Multiple on Horizontal on Xbrowse

Postby Silvio.Falconi » Tue Sep 27, 2022 8:45 pm

Cesar,
to select 2022 year I made

cFilter:= "LTRIM(STR(YEAR(FIELD->DATA)))= '" + nyear + "'"
oQry:SetFilter(cFilter)
oQry:GoTop()

and run ok


I f the user want show only ( 10,20,30,40,50,100,200,300,500) records How I must set the filter ?

I try with

nCount is the number selected by final user

IF nCount > 0
nInit:=oDbf:lastrec()-nCount
nEnd:= oDbf:lastrec()
ENDIF



cFilter:= "LTRIM(STR(YEAR(FIELD->DATA)))= '" + nyear + "' .and. '"+;
nInit + "' <= Ltrim(str(FIELD->RECNO())) .and. '"+;
nEnd + "' => Ltrim(str(FIELD->RECNO())) + "'"

but it make error on cfilter
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Creation an array Multiple on Horizontal on Xbrowse

Postby cmsoft » Tue Sep 27, 2022 10:04 pm

Hola Silvio, me alegro que te haya dado una idea de como solucionar el problema.
No soy muy hábil con dbfs, si lo tuviese que hacer con MySql usaría LIMIT n
User avatar
cmsoft
 
Posts: 1290
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 105 guests