Patch level :4.0 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento :"ripulito" il report; aggiunto il reset dei totali che pero' non funziona! git-svn-id: svn://10.65.10.50/trunk@14474 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
fabab13737
commit
d99b6c6741
@ -21,14 +21,6 @@
|
||||
<field x="1" y="2" type="Testo" width="15" id="121" pattern="1" text="Commessa" />
|
||||
</section>
|
||||
<section type="Head" level="1">
|
||||
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1.101
|
||||
MESSAGE RESET,F1.102
|
||||
MESSAGE RESET,F1.103
|
||||
MESSAGE RESET,F1.104
|
||||
MESSAGE RESET,F1.105
|
||||
MESSAGE RESET,F1.106
|
||||
MESSAGE RESET,F1.107
|
||||
MESSAGE RESET,F1.108</prescript>
|
||||
<field border="1" radius="100" x="1" type="Testo" valign="center" align="center" shade_offset="25" width="167" height="2.5" text="BILANCIO DI COMMESSA PER ESERCIZIO">
|
||||
<font face="Courier New" bold="1" size="16" />
|
||||
</field>
|
||||
@ -62,14 +54,6 @@ MESSAGE RESET,F1.108</prescript>
|
||||
<section type="Head" level="2" height="1.5" page_break="1">
|
||||
<groupby>LEVEL C; 2</groupby>
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<prescript description="H2 PRESCRIPT">MESSAGE RESET,F2.101
|
||||
MESSAGE RESET,F2.102
|
||||
MESSAGE RESET,F2.103
|
||||
MESSAGE RESET,F2.104
|
||||
MESSAGE RESET,F2.105
|
||||
MESSAGE RESET,F2.106
|
||||
MESSAGE RESET,F2.107
|
||||
MESSAGE RESET,F2.108</prescript>
|
||||
<field x="1" type="Array" bg_color="#C0C0C0" width="22">
|
||||
<source>LEVEL</source>
|
||||
<list>
|
||||
@ -95,14 +79,6 @@ MESSAGE RESET,F2.108</prescript>
|
||||
<section type="Head" level="3" height="1.5">
|
||||
<groupby>LEVEL</groupby>
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<prescript description="H3 PRESCRIPT">MESSAGE RESET,F3.101
|
||||
MESSAGE RESET,F3.102
|
||||
MESSAGE RESET,F3.103
|
||||
MESSAGE RESET,F3.104
|
||||
MESSAGE RESET,F3.105
|
||||
MESSAGE RESET,F3.106
|
||||
MESSAGE RESET,F3.107
|
||||
MESSAGE RESET,F3.108</prescript>
|
||||
<field x="3" type="Array" bg_color="#C0C0C0" width="40" pattern="1">
|
||||
<source>LEVEL</source>
|
||||
<list>
|
||||
|
@ -144,7 +144,7 @@ void TCRPA_report::analize_pconana_structure (const TString& prefix, const int d
|
||||
//se c'e' piu' di un campo da stampare per i Ricavi -> ci vuole un campo Totale per i ricavi
|
||||
if (codici_r.items() >= 1)
|
||||
{
|
||||
if (codici_r.items() == 1) //se il campo da stampare e' uno solo va
|
||||
if (codici_r.items() == 1) //se il campo da stampare e' uno solo->e' il totale del livello
|
||||
{
|
||||
codici_r.destroy();
|
||||
testate_r.destroy();
|
||||
@ -204,10 +204,12 @@ void TCRPA_report::offset_and_fill_columns(TReport_section& rep_sect, const TStr
|
||||
}
|
||||
switch (sect_type)
|
||||
{
|
||||
case 'H':
|
||||
new_field->set_picture(str_arr.row(i));
|
||||
case 'H': //gli header devono stampare l'intestazione
|
||||
{
|
||||
new_field->set_picture(str_arr.row(i));
|
||||
}
|
||||
break;
|
||||
case 'B':
|
||||
case 'B': //i body devono stampare i valori e sommarli ai totali nei footer
|
||||
{
|
||||
new_field->set_field(str_arr.row(i));
|
||||
TString ps = "MESSAGE ADD,F3.";
|
||||
@ -215,7 +217,7 @@ void TCRPA_report::offset_and_fill_columns(TReport_section& rep_sect, const TStr
|
||||
new_field->set_postscript(ps);
|
||||
}
|
||||
break;
|
||||
case 'F':
|
||||
case 'F': //i footer devono calcolarsi i totali!
|
||||
if (rep_sect.level() > 1)
|
||||
{
|
||||
new_field->set_field("");
|
||||
@ -241,34 +243,51 @@ void TCRPA_report::offset_and_fill_columns(TReport_section& rep_sect, const TStr
|
||||
}
|
||||
|
||||
|
||||
bool TCRPA_report::generate_columns (TString_array& codici, TString_array& testate)
|
||||
bool TCRPA_report::generate_columns (TString_array& codici, TString_array& testate, const int model_id)
|
||||
{
|
||||
//sezioni del report da modificare
|
||||
TReport_section& b1 = section('B', 1);
|
||||
|
||||
//controllo dell'esistenza dei campi modello da replicare e loro duplicazione e riempimento!
|
||||
TReport_field* b1_69 = b1.find_field(69);
|
||||
if (b1_69 == NULL)
|
||||
TReport_field* b1_model = b1.find_field(model_id);
|
||||
if (b1_model == NULL)
|
||||
return false;
|
||||
offset_and_fill_columns(b1, codici);
|
||||
|
||||
//testata
|
||||
//testate
|
||||
//la testata di pagina deve invece riempire le intestazioni delle colonne generate
|
||||
TReport_section& h0 = section('H', 0);
|
||||
|
||||
TReport_field* h0_69 = h0.find_field(69);
|
||||
if (h0_69 == NULL)
|
||||
warning_box(TR("Manca l'intestazione della colonna modello (H0.69)"));
|
||||
TReport_field* h0_model = h0.find_field(model_id);
|
||||
if (h0_model == NULL)
|
||||
warning_box(TR("Manca l'intestazione della colonna modello (H0.%d)"),model_id);
|
||||
else
|
||||
offset_and_fill_columns(h0, testate);
|
||||
|
||||
//le testate di sezione devono resettare i campi totale dei corrispondenti footers
|
||||
for (int j = 3; j > 0; j--)
|
||||
{
|
||||
TReport_section& head = section('H', j);
|
||||
if (head.items() > 0)
|
||||
{
|
||||
TString ps;
|
||||
for (int k = 1; k <= codici.items(); k++)
|
||||
{
|
||||
ps << "MESSAGE RESET,F";
|
||||
ps << head.level() << '.' << (k+model_id) << "\n";
|
||||
}
|
||||
head.set_prescript(ps);
|
||||
}
|
||||
}
|
||||
|
||||
//footers
|
||||
for (int i = 3; i > 0; i--)
|
||||
{
|
||||
TReport_section& foot = section('F', i);
|
||||
|
||||
TReport_field* foot_69 = foot.find_field(69);
|
||||
if (foot_69 == NULL)
|
||||
warning_box(TR("Manca la colonna modello (F%d.69)"), i);
|
||||
TReport_field* foot_model = foot.find_field(model_id);
|
||||
if (foot_model == NULL)
|
||||
warning_box(TR("Manca la colonna modello (F%d.%d)"), i, model_id);
|
||||
else
|
||||
offset_and_fill_columns(foot, codici);
|
||||
}
|
||||
@ -288,5 +307,5 @@ TCRPA_report::TCRPA_report (const char* rep_name, const TString& prefix, const i
|
||||
//..da stampare fino al livello richiesto!
|
||||
analize_pconana_structure (prefix, depth, codici, testate);
|
||||
//poi vanno generate le colonne del report corrispondenti alla struttura analizzata
|
||||
generate_columns (codici, testate);
|
||||
generate_columns (codici, testate, 69);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ protected:
|
||||
TString_array& codici, TString_array& testate) const;
|
||||
void analize_pconana_structure (const TString& prefix, const int depth,
|
||||
TString_array& codici, TString_array& testate) const;
|
||||
bool generate_columns (TString_array& codici, TString_array& testate);
|
||||
bool generate_columns (TString_array& codici, TString_array& testate, const int model_id);
|
||||
void offset_and_fill_columns(TReport_section& rep_sect, const TString_array& str_arr);
|
||||
public:
|
||||
TCRPA_report (const char* rep_name, const TString& prefix, const int depth);
|
||||
|
Loading…
x
Reference in New Issue
Block a user