1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- Editions Entité "ESF PLAGNE BELLECOTE" !-->
<edition>
<menu>
<menu title="Résultats" image="./res/32x32_ranking.png">
<menu title="Résultats Equipe avec Fille" image="./res/16x16_official.png" id="Top3EquipeAvecFille" choix_manche="1" equipe=""/>
</menu>
</menu>
<!-- Résultats regroupement 3 meilleurs temps par Equipe avec au moins une fille, ... -->
<report id="Top3EquipeAvecFille" title="Classement Equipe - Top 3 avec au moins une fille" header="1" first_header="0">
<lua>
teams = {}
<!-- Construire les équipes -->
for i=0,body:GetNbRows()-1 do
local eq = body:GetCell('Equipe',i)
local sexe = body:GetCell('Sexe',i)
local temps = body:GetCellTime('Tps',i)
if eq ~= nil and eq ~= '' and temps > 0 then
if teams[eq] == nil then
teams[eq] = {}
end
table.insert(teams[eq],{
temps = temps,
sexe = sexe
})
end
end
result = {}
<!-- Calcul du score équipe -->
for eq,data in pairs(teams) do
table.sort(data,function(a,b) return a.temps < b.temps end)
if #data >= 3 then
local total = 0
local fille = false
for k=1,3 do
total = total + data[k].temps
if data[k].sexe == 'F' then
fille = true
end
end
if fille == true then
table.insert(result,{
equipe = eq,
total = total
})
end
end
end
<!-- Trier les équipes -->
table.sort(result,function(a,b) return a.total < b.total end)
<!-- Effacer résultats individuels -->
body:Clear()
<!-- Générer tableau final -->
for i,v in ipairs(result) do
body:AddRow()
local r = body:GetNbRows()-1
body:SetCell('Clt',r,i)
body:SetCell('Equipe',r,v.equipe)
body:SetCellInt('Total',r,v.total)
end
</lua>
<order key="Clt Asc"/>
<paper orientation="portrait"/>
<body>
<call option="couleur_alternee" file="./edition/options.xml"/>
<font size="9"/>
<padding all="0px"/>
<spacing all="4"/>
<row value="auto"/>
<text col="6" align="center" label="Clt" font_weight="bold">$(Clt)</text>
<text col="40" align="left" label="Equipe" font_weight="bold">
$(Equipe)
</text>
<text col="15" align="right" label="Total Temps" font_weight="bold">
$(Total)
</text>
<line col_start="1" col_end="0" pen_size="4" border="bottom"/>
</body>
</report>
</edition> |
Partager