From d99b6c674159b982fc683c687388362d73f225b1 Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 14 Nov 2006 13:32:00 +0000 Subject: [PATCH] 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 --- ca/ca3800a.rep | 24 ------------------------ ca/ca3883.cpp | 51 ++++++++++++++++++++++++++++++++++---------------- ca/ca3883.h | 2 +- 3 files changed, 36 insertions(+), 41 deletions(-) diff --git a/ca/ca3800a.rep b/ca/ca3800a.rep index b6bac6190..376819af5 100755 --- a/ca/ca3800a.rep +++ b/ca/ca3800a.rep @@ -21,14 +21,6 @@
- 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 @@ -62,14 +54,6 @@ MESSAGE RESET,F1.108
LEVEL C; 2 - 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 LEVEL @@ -95,14 +79,6 @@ MESSAGE RESET,F2.108
LEVEL - 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 LEVEL diff --git a/ca/ca3883.cpp b/ca/ca3883.cpp index d14176363..9532799a4 100755 --- a/ca/ca3883.cpp +++ b/ca/ca3883.cpp @@ -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); } diff --git a/ca/ca3883.h b/ca/ca3883.h index 91f9a0f58..d33499683 100755 --- a/ca/ca3883.h +++ b/ca/ca3883.h @@ -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);