Aggiunta percentuale relativa alla fascia di eta in statistica per
sesso e eta' git-svn-id: svn://10.65.10.50/trunk@6166 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3ef299ef9a
commit
ffc99b5fd5
@ -232,10 +232,10 @@ void TStatSogxEta::crea_intestazione()
|
||||
TString256 sep;
|
||||
sep = "STATISTICA SOGGETTI PER SESSO E ETA' al ";
|
||||
sep << _data.string();
|
||||
sep.center_just(80);
|
||||
sep.center_just(120);
|
||||
row.put(sep);
|
||||
row.put("@>", 1);
|
||||
row.put("Pag. @#", 70);
|
||||
row.put("Pag. @#", 105);
|
||||
printer().setheaderline(2, row);
|
||||
sep = "";
|
||||
sep << "Categoria ";
|
||||
@ -247,20 +247,25 @@ void TStatSogxEta::crea_intestazione()
|
||||
ctd.read();
|
||||
if (ctd.good())
|
||||
sep << ctd.get("S0");
|
||||
sep.center_just(80);
|
||||
sep.center_just(120);
|
||||
row.reset();
|
||||
row.put(sep);
|
||||
printer().setheaderline(3, row);
|
||||
sep = "";
|
||||
sep << "Fascia di eta' Sconosc. Maschi Femmine Non spec. Totale";
|
||||
sep << "Fascia di eta' Sconosc. Maschi Femmine Non spec. Totale";
|
||||
row.reset();
|
||||
row.put(sep);
|
||||
printer().setheaderline(5, row);
|
||||
sep = "";
|
||||
sep << " Nro %rel %ass Nro %rel %ass Nro %rel %ass Nro %rel %ass Nro %ass";
|
||||
row.reset();
|
||||
row.put(sep);
|
||||
printer().setheaderline(6, row);
|
||||
sep = "";
|
||||
sep.fill('-',95);
|
||||
sep.fill('-',120);
|
||||
row.reset();
|
||||
row.put(sep);
|
||||
printer().setheaderline(6, row);
|
||||
printer().setheaderline(7, row);
|
||||
}
|
||||
|
||||
bool TStatSogxEta::stampa()
|
||||
@ -349,7 +354,7 @@ void TStatSogxEta::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
rigastampa << den;
|
||||
}
|
||||
}
|
||||
rigastampa.center_just(80);
|
||||
rigastampa.center_just(120);
|
||||
row.put(rigastampa);
|
||||
printer().setheaderline(1, row);
|
||||
|
||||
@ -378,36 +383,43 @@ void TStatSogxEta::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
rigastampa << valreal.string();
|
||||
rigastampa << " anni";
|
||||
totalefascia = ZERO;
|
||||
for (int j=0;j<_colonne->items();j++)
|
||||
totalefascia+=riga[j];
|
||||
// ciclo per stampa
|
||||
int pos = 15;
|
||||
for (int j=0;j<_colonne->items();j++)
|
||||
for (j=0;j<_colonne->items();j++)
|
||||
{
|
||||
rigatotali.aggiorna_valore(j,riga[j]);
|
||||
totalefascia+=riga[j];
|
||||
valore = "";
|
||||
valore.format("%8d",riga[j].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
if (totalegenerale != ZERO)
|
||||
pos=pos+10;
|
||||
if (totalefascia != ZERO)
|
||||
{
|
||||
real perc = (riga[j]/totalegenerale)*100;
|
||||
pos=pos+10;
|
||||
real perc = (riga[j]/totalefascia)*100;
|
||||
valore = "";
|
||||
valore << perc.string(3,2);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+6;
|
||||
}
|
||||
else
|
||||
pos = pos+16;
|
||||
pos = pos+6;
|
||||
if (totalegenerale != ZERO)
|
||||
{
|
||||
real perc = (riga[j]/totalegenerale)*100;
|
||||
valore = "";
|
||||
valore << perc.string(3,2);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
}
|
||||
pos = pos+6;
|
||||
}
|
||||
if (totalefascia != ZERO)
|
||||
{
|
||||
valore = "";
|
||||
valore.format("%8d",totalefascia.integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos=pos+10;
|
||||
if (totalegenerale != ZERO)
|
||||
{
|
||||
real perc = (totalefascia/totalegenerale)*100;
|
||||
pos=pos+10;
|
||||
valore = "";
|
||||
valore << perc.string(3,2);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
@ -420,7 +432,7 @@ void TStatSogxEta::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
|
||||
// stampa totali per sezione
|
||||
rigastampa = "";
|
||||
rigastampa.fill('-',95);
|
||||
rigastampa.fill('-',120);
|
||||
row.reset();
|
||||
row.put(rigastampa);
|
||||
printer().print(row);
|
||||
@ -436,17 +448,15 @@ void TStatSogxEta::stampa_sezione(TString16 codsez, TString16 codsot)
|
||||
valore = "";
|
||||
valore.format("%8d",rigatotali[i].integer());
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos=pos+16;
|
||||
if (totalegenerale != ZERO)
|
||||
{
|
||||
real perc = (rigatotali[i]/totalegenerale)*100;
|
||||
pos=pos+10;
|
||||
valore = "";
|
||||
valore << perc.string(3,2);
|
||||
rigastampa.overwrite((const char*)valore, pos);
|
||||
pos = pos+6;
|
||||
}
|
||||
else
|
||||
pos = pos+16;
|
||||
}
|
||||
pos = pos+6;
|
||||
}
|
||||
valore = "";
|
||||
valore.format("%8d",totale.integer());
|
||||
|
Loading…
x
Reference in New Issue
Block a user