#include "FiveWin.ch"
#include "xbrowse.ch"
function main()
local oDlg, oBrw, oFont, oBold
local aDato := {}
local aHead := {"" ,"Dia 1","Dia 2","Dia 3","Dia 4","Dia 5","Dia 6","Dia 7" }
aDato:= { { "algo 1", 0 , 2 , 1 , 2 , 0 , 2 , 2 },;
{ "algo 2", 0 , 1 , 4 , 1 , 1 , 0 , 2 },;
{ "algo 3", 1 , 0 , 0 , 3 , 1 , 4 , 1 },;
{ "algo 4", 2 , 0 , 2 , 0 , 3 , 0 , 3 },;
{ "algo 5", 1 , 2 , 1 , 2 , 0 , 1 , 0 },;
{ "algo 6", 0 , 1 , 0 , 0 , 0 , 0 , 0 },;
{ "algo 7", 0 , 0 , 0 , 0 , 0 , 0 , 4 } }
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
DEFINE FONT oBold NAME 'TAHOMA' SIZE 0,-12 BOLD
DEFINE DIALOG oDlg SIZE 400,300 PIXEL FONT oFont ;
TITLE 'Demo para Paco'
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
AUTOCOLS ;
HEADERS " " , "Dia 1","Dia 2","Dia 3","Dia 4","Dia 5","Dia 6","Dia 7" ;
ARRAY aDato CELL LINES NOBORDER FASTEDIT FOOTERS
oBrw:SetArray(aDato)
AEval( oBrw:aCols, { |o| o:cEditPicture := '99', ;
o:nFooterType := AGGR_COUNT ,; //AGGR_SUM ,;
o:bSumCondition := {|uVal, oCol| If( uVal == 1 .or. uVal == 2 .or. uVal == 4 , .t. , .f. ) } }, 2 )
oBrw:MakeTotals()
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED //On Init gBrowse(oBrw:aArrayData)
return nil