Aggiunto totale soggetti stampati per sezione in elenco iscritti/dimessi
git-svn-id: svn://10.65.10.50/trunk@6167 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ffc99b5fd5
commit
7c3f18055e
@ -37,6 +37,7 @@ class TStampaIscritti : public TPrintapp
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipostampa;
|
||||
int _contatore;
|
||||
TString16 _codsez, _codsot;
|
||||
char _tipo_iscdim; // iscritti o dimessi
|
||||
TDate _dataini, _datafin;
|
||||
@ -50,11 +51,13 @@ 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);
|
||||
|
||||
public:
|
||||
void crea_intestazione();
|
||||
void filtra_sezioni();
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
void footer_sezione();
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TStampaIscritti() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
||||
};
|
||||
@ -171,7 +174,8 @@ bool TStampaIscritti::preprocess_page(int file, int counter)
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
footer_sezione();
|
||||
_contatore = 0;
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
header_sezione(codsez, codsot);
|
||||
@ -180,9 +184,29 @@ bool TStampaIscritti::preprocess_page(int file, int counter)
|
||||
if (_tipostampa==etichette)
|
||||
if (printer().rows_left() < _form_eti->get_body().height())
|
||||
printer().formfeed();
|
||||
_contatore++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
print_action TStampaIscritti::postprocess_print(int file, int counter)
|
||||
{
|
||||
if (_contatore > 0)
|
||||
footer_sezione();
|
||||
return NEXT_PAGE;
|
||||
}
|
||||
|
||||
void TStampaIscritti::footer_sezione()
|
||||
{
|
||||
// stampa totale soggetti appartenenti alla sezione
|
||||
reset_footer();
|
||||
TString sep(80);
|
||||
sep.fill('-');
|
||||
set_footer(2, (const char *) sep);
|
||||
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _contatore);
|
||||
printer().formfeed();
|
||||
reset_footer();
|
||||
}
|
||||
|
||||
void TStampaIscritti::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
@ -215,6 +239,7 @@ bool TStampaIscritti::set_print(int m)
|
||||
_tipostampa = elenco;
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
_contatore = 0;
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipostampa = etichette;
|
||||
@ -292,6 +317,7 @@ void TStampaIscritti::crea_intestazione()
|
||||
set_header(3, (const char *) sep);
|
||||
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gData isc.@60gData dim.");
|
||||
set_header(5,"@0g--------@9g--@12g-------------------------@38g----------@49g----------@60g----------");
|
||||
printer().footerlen(3);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user