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;
|
TString256 sep;
|
||||||
sep = "STATISTICA SOGGETTI PER SESSO E ETA' al ";
|
sep = "STATISTICA SOGGETTI PER SESSO E ETA' al ";
|
||||||
sep << _data.string();
|
sep << _data.string();
|
||||||
sep.center_just(80);
|
sep.center_just(120);
|
||||||
row.put(sep);
|
row.put(sep);
|
||||||
row.put("@>", 1);
|
row.put("@>", 1);
|
||||||
row.put("Pag. @#", 70);
|
row.put("Pag. @#", 105);
|
||||||
printer().setheaderline(2, row);
|
printer().setheaderline(2, row);
|
||||||
sep = "";
|
sep = "";
|
||||||
sep << "Categoria ";
|
sep << "Categoria ";
|
||||||
@ -247,7 +247,7 @@ void TStatSogxEta::crea_intestazione()
|
|||||||
ctd.read();
|
ctd.read();
|
||||||
if (ctd.good())
|
if (ctd.good())
|
||||||
sep << ctd.get("S0");
|
sep << ctd.get("S0");
|
||||||
sep.center_just(80);
|
sep.center_just(120);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(sep);
|
row.put(sep);
|
||||||
printer().setheaderline(3, row);
|
printer().setheaderline(3, row);
|
||||||
@ -257,10 +257,15 @@ void TStatSogxEta::crea_intestazione()
|
|||||||
row.put(sep);
|
row.put(sep);
|
||||||
printer().setheaderline(5, row);
|
printer().setheaderline(5, row);
|
||||||
sep = "";
|
sep = "";
|
||||||
sep.fill('-',95);
|
sep << " Nro %rel %ass Nro %rel %ass Nro %rel %ass Nro %rel %ass Nro %ass";
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(sep);
|
row.put(sep);
|
||||||
printer().setheaderline(6, row);
|
printer().setheaderline(6, row);
|
||||||
|
sep = "";
|
||||||
|
sep.fill('-',120);
|
||||||
|
row.reset();
|
||||||
|
row.put(sep);
|
||||||
|
printer().setheaderline(7, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TStatSogxEta::stampa()
|
bool TStatSogxEta::stampa()
|
||||||
@ -349,7 +354,7 @@ void TStatSogxEta::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
rigastampa << den;
|
rigastampa << den;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rigastampa.center_just(80);
|
rigastampa.center_just(120);
|
||||||
row.put(rigastampa);
|
row.put(rigastampa);
|
||||||
printer().setheaderline(1, row);
|
printer().setheaderline(1, row);
|
||||||
|
|
||||||
@ -378,36 +383,43 @@ void TStatSogxEta::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
rigastampa << valreal.string();
|
rigastampa << valreal.string();
|
||||||
rigastampa << " anni";
|
rigastampa << " anni";
|
||||||
totalefascia = ZERO;
|
totalefascia = ZERO;
|
||||||
|
for (int j=0;j<_colonne->items();j++)
|
||||||
|
totalefascia+=riga[j];
|
||||||
// ciclo per stampa
|
// ciclo per stampa
|
||||||
int pos = 15;
|
int pos = 15;
|
||||||
for (int j=0;j<_colonne->items();j++)
|
for (j=0;j<_colonne->items();j++)
|
||||||
{
|
{
|
||||||
rigatotali.aggiorna_valore(j,riga[j]);
|
rigatotali.aggiorna_valore(j,riga[j]);
|
||||||
totalefascia+=riga[j];
|
|
||||||
valore = "";
|
valore = "";
|
||||||
valore.format("%8d",riga[j].integer());
|
valore.format("%8d",riga[j].integer());
|
||||||
rigastampa.overwrite((const char*)valore, pos);
|
rigastampa.overwrite((const char*)valore, pos);
|
||||||
if (totalegenerale != ZERO)
|
|
||||||
{
|
|
||||||
real perc = (riga[j]/totalegenerale)*100;
|
|
||||||
pos=pos+10;
|
pos=pos+10;
|
||||||
|
if (totalefascia != ZERO)
|
||||||
|
{
|
||||||
|
real perc = (riga[j]/totalefascia)*100;
|
||||||
valore = "";
|
valore = "";
|
||||||
valore << perc.string(3,2);
|
valore << perc.string(3,2);
|
||||||
rigastampa.overwrite((const char*)valore, pos);
|
rigastampa.overwrite((const char*)valore, pos);
|
||||||
pos = pos+6;
|
|
||||||
}
|
}
|
||||||
else
|
pos = pos+6;
|
||||||
pos = pos+16;
|
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)
|
if (totalefascia != ZERO)
|
||||||
{
|
{
|
||||||
valore = "";
|
valore = "";
|
||||||
valore.format("%8d",totalefascia.integer());
|
valore.format("%8d",totalefascia.integer());
|
||||||
rigastampa.overwrite((const char*)valore, pos);
|
rigastampa.overwrite((const char*)valore, pos);
|
||||||
|
pos=pos+10;
|
||||||
if (totalegenerale != ZERO)
|
if (totalegenerale != ZERO)
|
||||||
{
|
{
|
||||||
real perc = (totalefascia/totalegenerale)*100;
|
real perc = (totalefascia/totalegenerale)*100;
|
||||||
pos=pos+10;
|
|
||||||
valore = "";
|
valore = "";
|
||||||
valore << perc.string(3,2);
|
valore << perc.string(3,2);
|
||||||
rigastampa.overwrite((const char*)valore, pos);
|
rigastampa.overwrite((const char*)valore, pos);
|
||||||
@ -420,7 +432,7 @@ void TStatSogxEta::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
|
|
||||||
// stampa totali per sezione
|
// stampa totali per sezione
|
||||||
rigastampa = "";
|
rigastampa = "";
|
||||||
rigastampa.fill('-',95);
|
rigastampa.fill('-',120);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put(rigastampa);
|
row.put(rigastampa);
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
@ -436,17 +448,15 @@ void TStatSogxEta::stampa_sezione(TString16 codsez, TString16 codsot)
|
|||||||
valore = "";
|
valore = "";
|
||||||
valore.format("%8d",rigatotali[i].integer());
|
valore.format("%8d",rigatotali[i].integer());
|
||||||
rigastampa.overwrite((const char*)valore, pos);
|
rigastampa.overwrite((const char*)valore, pos);
|
||||||
|
pos=pos+16;
|
||||||
if (totalegenerale != ZERO)
|
if (totalegenerale != ZERO)
|
||||||
{
|
{
|
||||||
real perc = (rigatotali[i]/totalegenerale)*100;
|
real perc = (rigatotali[i]/totalegenerale)*100;
|
||||||
pos=pos+10;
|
|
||||||
valore = "";
|
valore = "";
|
||||||
valore << perc.string(3,2);
|
valore << perc.string(3,2);
|
||||||
rigastampa.overwrite((const char*)valore, pos);
|
rigastampa.overwrite((const char*)valore, pos);
|
||||||
pos = pos+6;
|
|
||||||
}
|
}
|
||||||
else
|
pos = pos+6;
|
||||||
pos = pos+16;
|
|
||||||
}
|
}
|
||||||
valore = "";
|
valore = "";
|
||||||
valore.format("%8d",totale.integer());
|
valore.format("%8d",totale.integer());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user