diff --git a/at/at4300.cpp b/at/at4300.cpp index 4fc15a7ab..776a2cc01 100755 --- a/at/at4300.cpp +++ b/at/at4300.cpp @@ -55,7 +55,7 @@ class TStampaConvocazioni : public TPrintapp int _numconv; bool _definitiva; int _etlarghezza, _etcolonne; - int _contatore; + int _contatore, _totfinestampa; bool _provastampa; protected: @@ -64,6 +64,7 @@ protected: virtual bool set_print(int m); virtual void set_page(int file, int cnt); virtual bool preprocess_page (int file, int counter); + virtual print_action postprocess_print(int file, int counter); //virtual print_action postprocess_page (int file, int counter); ts dati_cartoline(); @@ -71,6 +72,8 @@ public: void crea_intestazione(); void filtra_sezioni(); void header_sezione(const TString16 codsez, const TString16 codsot); + void footer_sezione(); + void fine_stampa(); void dati_sezione(const TString16 codsez, const TString16 codsot); TStampaConvocazioni() : _data_stampa(TODAY), _cognome_nome("",25) {} }; @@ -282,6 +285,44 @@ print_action TStampaConvocazioni::postprocess_page(int file, int counter) } */ +void TStampaConvocazioni::footer_sezione() +{ + // stampa totale soggetti a fine pagina + reset_footer(); + TString sep(80); + sep.fill('-'); + set_footer(1, (const char *) sep); + set_footer(2,"TOTALE PER SEZIONE %d", _contatore); + printer().formfeed(); + reset_footer(); +} + +void TStampaConvocazioni::fine_stampa() +{ + // stampa totale soggetti a fine stampa + + reset_footer(); + printer().footerlen(20); + TString sep(80); + sep.fill('-'); + set_footer(1, (const char *) sep); + set_footer(2,"TOTALE GENERALE %d", _totfinestampa); + printer().formfeed(); + reset_footer(); +} + +print_action TStampaConvocazioni::postprocess_print(int file, int counter) +{ + if (_tipostampa==elencocon || _tipostampa==elencorit) + { + if (_contatore > 0) + footer_sezione(); + if (_totfinestampa > 0 && _contatore != _totfinestampa) + fine_stampa(); + } + return NEXT_PAGE; +} + bool TStampaConvocazioni::preprocess_page(int file, int counter) { if (_tipostampa==elencocon || _tipostampa==elencorit) @@ -297,7 +338,7 @@ bool TStampaConvocazioni::preprocess_page(int file, int counter) if ((_codsez!=codsez)||(_codsot!=codsot)) { if ((_codsez != "**") && (_contatore > 0)) - printer().formfeed(); + footer_sezione(); _contatore = 0; _codsez = codsez; _codsot = codsot; @@ -330,6 +371,7 @@ bool TStampaConvocazioni::preprocess_page(int file, int counter) else { _contatore++; + _totfinestampa++; return TRUE; } } @@ -339,6 +381,7 @@ bool TStampaConvocazioni::preprocess_page(int file, int counter) else { _contatore++; + _totfinestampa++; return TRUE; } } @@ -411,6 +454,7 @@ bool TStampaConvocazioni::set_print(int) _codsez = "**"; _codsot = "**"; _contatore = 0; + _totfinestampa = 0; _provastampa = TRUE; reset_files(); add_file(LF_SOGGETTI); @@ -430,6 +474,7 @@ bool TStampaConvocazioni::set_print(int) // filtro su data e altri filtri che non posso mettere nella setfilter current_cursor()->set_filterfunction (filter_func_conv, TRUE); reset_print(); + printer().footerlen(0); crea_intestazione(); return TRUE; } @@ -461,6 +506,7 @@ void TStampaConvocazioni::crea_intestazione() set_header(5,"@0gCod.CL@7gNC@11gCognome e nome@37gNato il@48gGr.@52gRh@55gKell@60gFen.Rh@67gDu@71gUltima donaz.@85gData pros.@96gTel. abitaz.@111gTelefono altro"); set_header(6,"@0gTess.@37gCat.don@71gUltima idon.@85gInt.SI@96gTelefono lav."); set_header(7,"@0g------@7g---@11g-------------------------@37g----------@48g--- --- --- ------ --@71g---------- --@85g---------- --@96g--------------@111g---------------"); + printer().footerlen(3); } }