Mr. Rao:
Is it possible to get these headers in xBrowse, if yes how can I do it?
Please an example
With Best regards
#include "fivewin.ch"
REQUEST DBFCDX
function Main()
local oDlg, oBrw, oFont
USE CUSTOMER SHARED NEW VIA "DBFCDX"
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 800,500 PIXEL TRUEPIXEL ;
FONT oFont RESIZABLE
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE "CUSTOMER" AUTOCOLS ;
CELL LINES NOBORDER STYLE FLAT
WITH OBJECT oBrw
:bClrHeader := { || { 0, CLR_WHITE } }
:bClrGrad := { || { { 1, CLR_WHITE, CLR_WHITE } } }
:nHeadStrAligns := AL_CENTER
:nTopBarHeight := 30
:cCaption := ""
:SetChecks()
:SetGroupHeader( "NAME", 2, 3 )
:SetGroupHeader( "GROUP2",5, 7 )
:AutoFit()
:bPainted := { |hDC| oBrw:SayText( "CUSTOMER", { 0,0,30,nil } ) }
//
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
oBrw:lDrawBorder := .t.
nageswaragunupudi wrote:Also add
- Code: Select all Expand view
oBrw:lDrawBorder := .t.
local aSuperGroup:= {"Venus Nord","Venus Centro","Venus Sud"}
//aSuperGroup 1
local aHeader1:= {"Milano","Genova","Torino","Venezia"}
//aSuperGroup 2
local aHeader2:= {"Roma","Firenze","Cagliari","Nazionale"}
//aSuperGroup 3
local aHeader3:= {"Napoli","Bari","Palermo"}
#include "fivewin.ch"
REQUEST DBFCDX
function Main()
local oDlg, oBrw, oFont
local aSuperGroup:= {"Venus Nord","Venus Centro","Venus Sud"}
//aSuperGroup 1
local aHeader1:= {"Milano","Genova","Torino","Venezia"}
//aSuperGroup 2
local aHeader2:= {"Roma","Firenze","Cagliari","Nazionale"}
//aSuperGroup 3
local aHeader3:= {"Napoli","Bari","Palermo"}
local cdbfPath:=".\data\"
local oDbf
local aArray
oDbf := TDatabase():Open( , cdbfPath+"LOTTO", "DBFCDX", .T. )
oDbf:setorder(1)
oDbf:GoTop()
aArray := Build_Array_Venus(oDbf)
//xbrowser aArray
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 800,500 PIXEL TRUEPIXEL ;
FONT oFont RESIZABLE
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
ARRAY aArray AUTOCOLS ;
CELL LINES NOBORDER STYLE FLAT
SetupBrowseHorizontal(oBrw)
oBrw:aCols[1]:cHeader := "Data"
oBrw:SetGroupHeader( aSuperGroup[1], 2, 21 )
oBrw:SetGroupHeader( aSuperGroup[2], 22, 41 )
oBrw:SetGroupHeader( aSuperGroup[3], 42, 56 )
oBrw:CreateFromCode()
/* WITH OBJECT oBrw
:bClrHeader := { || { 0, CLR_WHITE } }
:bClrGrad := { || { { 1, CLR_WHITE, CLR_WHITE } } }
:nHeadStrAligns := AL_CENTER
:nTopBarHeight := 30
:cCaption := ""
:SetChecks()
:SetGroupHeader( aSuperGroup[1], 2, 21 )
:SetGroupHeader( aSuperGroup[2], 22, 41 )
:SetGroupHeader( aSuperGroup[3], 42, 56 )
:AutoFit()
:bPainted := { |hDC| oBrw:SayText( "LOTTO", { 0,0,30,nil } ) }
//
:CreateFromCode()
END
*/
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
//---------------------------------------------------------//
static function Build_Array_Venus(oDbf,n,nOpt)
local aTemp:={}, i, nIni
default n := 0
default nOpt := 1
oDbf:GoTop()
If nOpt=1
i := 1
Endif
do while !oDbf:Eof
AaDd(aTemp, { oDbf:data,;
oDbf:mi1,oDbf:mi2,oDbf:mi3,oDbf:mi4,oDbf:mi5,;
oDbf:ge1,oDbf:ge2,oDbf:ge3,oDbf:ge4,oDbf:ge5,;
oDbf:to1,oDbf:to2,oDbf:to3,oDbf:to4,oDbf:to5,;
oDbf:ve1,oDbf:ve2,oDbf:ve3,oDbf:ve4,oDbf:ve5,;
oDbf:rm1,oDbf:rm2,oDbf:rm3,oDbf:rm4,oDbf:rm5,;
oDbf:fi1,oDbf:fi2,oDbf:fi3,oDbf:fi4,oDbf:fi5,;
oDbf:ca1,oDbf:ca2,oDbf:ca3,oDbf:ca4,oDbf:ca5,;
oDbf:nz1,oDbf:nz2,oDbf:nz3,oDbf:nz4,oDbf:nz5,;
oDbf:na1,oDbf:na2,oDbf:na3,oDbf:na4,oDbf:na5,;
oDbf:ba1,oDbf:ba2,oDbf:ba3,oDbf:ba4,oDbf:ba5,;
oDbf:pa1,oDbf:pa2,oDbf:pa3,oDbf:pa4,oDbf:pa5} )
oDbf:Skip()
If nOpt=1
if i >= n .and. n > 0
exit
endif
i++
Endif
enddo
RETURN aTemp
//---------------------------------------------------------------//
Function SetupBrowseHorizontal(oBrw)
WITH OBJECT oBrw
:nRowHeight := 30
:nClrBorder := CLR_GRAY
:lHscroll := .t.
:l2007 := .F.
:l2015 := .T.
:lRecordSelector := .F.
:lAllowRowSizing := .F.
:lAllowColSwapping := .F.
:lAllowColHiding := .F.
:lRecordSelector := .F.
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
/* :SetGroupHeader( "Estrazione", 1, 2)
:SetGroupHeader( "Bari", 3, 7 )
:SetGroupHeader( "Cagliari", 8, 12 )
:SetGroupHeader( "Firenze", 13, 17 )
:SetGroupHeader( "Genova", 18, 22 )
:SetGroupHeader( "Milano", 23, 27 )
:SetGroupHeader( "Napoli", 28, 32 )
:SetGroupHeader( "Palermo", 33, 37 )
:SetGroupHeader( "Roma", 38, 42 )
:SetGroupHeader( "Torino", 43, 47 )
:SetGroupHeader( "Venezia", 48, 52 )
:SetGroupHeader( "Nazionale", 53, 57 )
*/
FOR i := 3 TO LEN(:aCols)
oCol := :aCols[ i ]
oCol:nWidth := 17
NEXT
FOR i := 1 TO 1
oCol := :aCols[ i ]
oCol:nWidth := 60
oCol:nColDividerStyle := LINESTYLE_BLACK
oCol:bClrStd := {|| { CLR_WHITE, RGB(255,0,0) } }
NEXT
END
RETURN NIL
//---------------------------------------------------------------------
AaDd(aTemp, { oDbf:data,;
strzero(oDbf:mi1,2)+" "+strzero(oDbf:mi2,2)+" "+strzero(oDbf:mi3,2)+" "+strzero(oDbf:mi4,2)+" "+strzero(oDbf:mi5,2),;
strzero(oDbf:ge1,2)+" "+strzero(oDbf:ge2,2)+" "+strzero(oDbf:ge3,2)+" "+strzero(oDbf:ge4,2)+" "+strzero(oDbf:ge5,2),;
strzero(oDbf:to1,2)+" "+strzero(oDbf:to2,2)+" "+strzero(oDbf:to3,2)+" "+strzero(oDbf:to4,2)+" "+strzero(oDbf:to5,2),;
strzero(oDbf:ve1,2)+" "+strzero(oDbf:ve2,2)+" "+strzero(oDbf:ve3,2)+" "+strzero(oDbf:ve4,2)+" "+strzero(oDbf:ve5,2),;
strzero(oDbf:rm1,2)+" "+strzero(oDbf:rm2,2)+" "+strzero(oDbf:rm3,2)+" "+strzero(oDbf:rm4,2)+" "+strzero(oDbf:rm5,2),;
strzero(oDbf:fi1,2)+" "+strzero(oDbf:fi2,2)+" "+strzero(oDbf:fi3,2)+" "+strzero(oDbf:fi4,2)+" "+strzero(oDbf:fi5,2),;
strzero(oDbf:ca1,2)+" "+strzero(oDbf:ca2,2)+" "+strzero(oDbf:ca3,2)+" "+strzero(oDbf:ca4,2)+" "+strzero(oDbf:ca5,2),;
strzero(oDbf:nz1,2)+" "+strzero(oDbf:nz2,2)+" "+strzero(oDbf:nz3,2)+" "+strzero(oDbf:nz4,2)+" "+strzero(oDbf:nz5,2),;
strzero(oDbf:na1,2)+" "+strzero(oDbf:na2,2)+" "+strzero(oDbf:na3,2)+" "+strzero(oDbf:na4,2)+" "+strzero(oDbf:na5,2),;
strzero(oDbf:ba1,2)+" "+strzero(oDbf:ba2,2)+" "+strzero(oDbf:ba3,2)+" "+strzero(oDbf:ba4,2)+" "+strzero(oDbf:ba5,2),;
strzero(oDbf:pa1,2)+" "+strzero(oDbf:pa2,2)+" "+strzero(oDbf:pa3,2)+" "+strzero(oDbf:pa4,2)+" "+strzero(oDbf:pa5,2)} )
:SetGroupHeader( aSuperGroup[1], 2, 5 )
:SetGroupHeader( aSuperGroup[2], 6, 9 )
:SetGroupHeader( aSuperGroup[3], 10, 12)
oBrw:aCols[2]:cHeader := aHeader1[1]
oBrw:aCols[3]:cHeader := aHeader1[2]
oBrw:aCols[4]:cHeader := aHeader1[3]
oBrw:aCols[5]:cHeader := aHeader1[4]
oBrw:aCols[6]:cHeader := aHeader2[1]
oBrw:aCols[7]:cHeader := aHeader2[2]
oBrw:aCols[8]:cHeader := aHeader2[3]
oBrw:aCols[9]:cHeader := aHeader2[4]
oBrw:aCols[10]:cHeader := aHeader3[1]
oBrw:aCols[11]:cHeader := aHeader3[2]
oBrw:aCols[12]:cHeader := aHeader3[3]
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 22 guests