Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : tolto controllo inutile (stringa.ok()) e messo totale parziale e finale


git-svn-id: svn://10.65.10.50/trunk@9227 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 2000-10-10 08:08:04 +00:00
parent 1aa1628827
commit 2cbf368c17
7 changed files with 319 additions and 86 deletions

View File

@ -44,7 +44,7 @@ class TStampaSospesi : public TPrintapp
TDate _dataini, _datafin, _sodataini, _sodatafin;
ts _tipostampa;
TString16 _codsez, _codsot, _motivo1, _motivo2, _motivo3, _motivo4, _motivo5, _tiposo, _prosstipo;
int _etlarghezza, _etcolonne, _contatore;
int _etlarghezza, _etcolonne, _contatore, _totale;
bool _motivi;
static bool filter_func_sospesi(const TRelation* rel);
@ -62,6 +62,7 @@ public:
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
void footer_sezione();
void fine_stampa();
TMask& app_mask() { return *_msk; }
TStampaSospesi() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",30), _motivo("",5) {}
};
@ -281,6 +282,7 @@ bool TStampaSospesi::preprocess_page(int file, int counter)
if (printer().rows_left() < _form_eti->get_body().height())
printer().formfeed();
_contatore++;
_totale++;
return TRUE;
}
@ -288,6 +290,7 @@ print_action TStampaSospesi::postprocess_print(int file, int counter)
{
if (_contatore > 0)
footer_sezione();
fine_stampa();
return NEXT_PAGE;
}
@ -332,6 +335,24 @@ void TStampaSospesi::footer_sezione()
reset_footer();
}
}
void TStampaSospesi::fine_stampa()
{
// stampa totale soggetti a fine stampa
if (_tipostampa==sintetico || _tipostampa==completo)
{
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
if (_totale > 0 && _totale != _contatore)
{
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _totale);
printer().formfeed();
}
reset_footer();
}
}
bool TStampaSospesi::set_print(int m)
{
@ -347,6 +368,7 @@ bool TStampaSospesi::set_print(int m)
_tipostampa = sintetico;
_codsez = _codsot = "**";
_contatore = 0;
_totale = 0;
}
break;
case F_COMPLETO:
@ -354,7 +376,8 @@ bool TStampaSospesi::set_print(int m)
_tipostampa = completo;
_codsez = _codsot = "**";
_contatore = 0;
}
_totale = 0;
}
break;
case F_ETICHETTE:
_tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;

View File

@ -42,7 +42,7 @@ class TStampaPerEta : public TPrintapp
TDate _dataini, _datafin;
ts _tipostampa;
TString16 _codsez, _codsot;
int _etlarghezza, _etcolonne;
int _etlarghezza, _etcolonne, _contatore, _totale;
bool _stampa80;
@ -58,6 +58,8 @@ public:
void crea_intestazione();
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
void footer_sezione();
void fine_stampa();
TMask& app_mask() { return *_msk; }
TStampaPerEta() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
@ -189,7 +191,7 @@ void TStampaPerEta::header_sezione(const TString16 codsez, const TString16 codso
intestazione << codsot;
intestazione << ' ';
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
if (densot.not_empty())
{
intestazione << '/';
intestazione << densot;
@ -228,7 +230,8 @@ bool TStampaPerEta::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);
@ -239,15 +242,52 @@ bool TStampaPerEta::preprocess_page(int file, int counter)
if (_tipostampa==etichette)
if (printer().rows_left() < _form_eti->get_body().height())
printer().formfeed();
_contatore++;
_totale++;
return TRUE;
}
print_action TStampaPerEta::postprocess_print(int file, int counter)
{
printer().formfeed();
if (_contatore > 0)
footer_sezione();
fine_stampa();
return NEXT_PAGE;
}
void TStampaPerEta::footer_sezione()
{
// stampa totale soggetti appartenenti alla sezione
if (_tipostampa==elenco)
{
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 TStampaPerEta::fine_stampa()
{
// stampa totale soggetti a fine stampa
if (_tipostampa==elenco)
{
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
if (_totale > 0 && _totale != _contatore)
{
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _totale);
printer().formfeed();
}
reset_footer();
}
}
bool TStampaPerEta::set_print(int m)
{
TPrinter& p = printer();
@ -262,6 +302,8 @@ bool TStampaPerEta::set_print(int m)
_tipostampa = elenco;
_codsez = "**";
_codsot = "**";
_contatore = 0;
_totale = 0;
}
break;
case F_ETICHETTE:
@ -282,20 +324,21 @@ bool TStampaPerEta::set_print(int m)
const TString16 catqua = _msk->get(F_CAT4);
const TString16 catqui = _msk->get(F_CAT5);
const TString16 catses = _msk->get(F_CAT6);
if (catpri.not_empty() && catpri.ok())
if (catpri.not_empty())
_categorie.add((const char*) catpri);
if (catsec.not_empty() && catsec.ok())
if (catsec.not_empty())
_categorie.add((const char*) catsec);
if (catter.not_empty() && catter.ok())
if (catter.not_empty())
_categorie.add((const char*) catter);
if (catqua.not_empty() && catqua.ok())
if (catqua.not_empty())
_categorie.add((const char*) catqua);
if (catqui.not_empty() && catqui.ok())
if (catqui.not_empty())
_categorie.add((const char*) catqui);
if (catses.not_empty() && catses.ok())
if (catses.not_empty())
_categorie.add((const char*) catses);
current_cursor()->set_filterfunction (filter_func_pereta);
reset_print();
printer().footerlen(0);
crea_intestazione();
return TRUE;
}
@ -353,6 +396,7 @@ void TStampaPerEta::crea_intestazione()
set_header(5,"@0gTessera@49gCAP/Località/Comune/Prov.@116gTelefono altro");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------");
}
printer().footerlen(3);
}
}

View File

@ -43,7 +43,7 @@ class TStampaEsclusi : public TPrintapp
TDate _data_stampa;
ts _tipostampa;
TString16 _codsez, _codsot;
int _etlarghezza, _etcolonne;
int _etlarghezza, _etcolonne, _totale, _contatore;
protected:
virtual bool user_create();
@ -57,6 +57,8 @@ public:
void crea_intestazione();
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
void footer_sezione();
void fine_stampa();
TMask& app_mask() { return *_msk; }
TStampaEsclusi() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
@ -155,7 +157,8 @@ bool TStampaEsclusi::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);
@ -164,12 +167,16 @@ bool TStampaEsclusi::preprocess_page(int file, int counter)
if (_tipostampa==etichette)
if (printer().rows_left() < _form_eti->get_body().height())
printer().formfeed();
_contatore++;
_totale++;
return TRUE;
}
print_action TStampaEsclusi::postprocess_print(int file, int counter)
{
printer().formfeed();
if (_contatore > 0)
footer_sezione();
fine_stampa();
return NEXT_PAGE;
}
@ -184,7 +191,7 @@ void TStampaEsclusi::header_sezione(const TString16 codsez, const TString16 cods
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
if (densot.not_empty())
{
intestazione << "/";
intestazione << densot;
@ -194,6 +201,39 @@ void TStampaEsclusi::header_sezione(const TString16 codsez, const TString16 cods
return;
}
void TStampaEsclusi::footer_sezione()
{
// stampa totale soggetti appartenenti alla sezione
if (_tipostampa==elenco)
{
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 TStampaEsclusi::fine_stampa()
{
// stampa totale soggetti a fine stampa
if (_tipostampa==elenco)
{
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
if (_totale > 0 && _totale != _contatore)
{
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _totale);
printer().formfeed();
}
reset_footer();
}
}
bool TStampaEsclusi::set_print(int)
{
TPrinter& p = printer();
@ -208,6 +248,8 @@ bool TStampaEsclusi::set_print(int)
_tipostampa = elenco;
_codsez = "**";
_codsot = "**";
_contatore = 0;
_totale = 0;
}
break;
case F_ETICHETTE:
@ -221,7 +263,7 @@ bool TStampaEsclusi::set_print(int)
filtra_sezioni();
// filtro per tipo esclusione
_tipoesc = _msk->get(F_TIPO);
if (_tipoesc.not_empty() && _tipoesc.ok())
if (_tipoesc.not_empty())
current_cursor()->setfilter(format("ESCLUSO == \"%s\"",(const char*)_tipoesc));
else
current_cursor()->setfilter("ESCLUSO != \"\"");
@ -233,22 +275,23 @@ bool TStampaEsclusi::set_print(int)
const TString16 catqua = _msk->get(F_CAT4);
const TString16 catqui = _msk->get(F_CAT5);
const TString16 catses = _msk->get(F_CAT6);
if (catpri.not_empty() && catpri.ok())
if (catpri.not_empty())
_categorie.add((const char*) catpri);
if (catsec.not_empty() && catsec.ok())
if (catsec.not_empty())
_categorie.add((const char*) catsec);
if (catter.not_empty() && catter.ok())
if (catter.not_empty())
_categorie.add((const char*) catter);
if (catqua.not_empty() && catqua.ok())
if (catqua.not_empty())
_categorie.add((const char*) catqua);
if (catqui.not_empty() && catqui.ok())
if (catqui.not_empty())
_categorie.add((const char*) catqui);
if (catses.not_empty() && catses.ok())
if (catses.not_empty())
_categorie.add((const char*) catses);
// filtro per termine esclusione
_termineesc = _msk->get(F_DATA);
current_cursor()->set_filterfunction(filter_func_esclusi);
reset_print();
printer().footerlen(0);
crea_intestazione();
return TRUE;
}
@ -263,7 +306,7 @@ void TStampaEsclusi::crea_intestazione()
{
TString sep(100);
sep = "ELENCO ESCLUSI";
if ((_tipoesc.ok()) && (_tipoesc.not_empty()))
if (_tipoesc.not_empty())
{
sep << " ";
sep << _tipoesc;
@ -286,6 +329,7 @@ void TStampaEsclusi::crea_intestazione()
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gEsclusione@63gMotivo");
set_header(5,"@49gTipo Termine");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g-------------@63g------------------------------");
printer().footerlen(3);
}
}

View File

@ -58,7 +58,7 @@ class TStampaModificati : public TPrintapp
TString16 _codsez, _codsot, _utente;
TString80 _eledon;
TString80 _eleben1,_eleben2;
int _lenpage, _schxpag;
int _lenpage, _schxpag, _totale, _contatore;
TString16 _schformato;
protected:
@ -73,6 +73,8 @@ public:
void crea_intestazione();
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
void footer_sezione();
void fine_stampa();
TMask& app_mask() { return *_msk; }
TStampaModificati() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
@ -89,7 +91,11 @@ print_action TStampaModificati::postprocess_print(int file, int counter)
if ((_tipostampa == schede) && (_schxpag > 1))
printer().formlen(_lenpage);
else
printer().formfeed();
{
if (_contatore > 0)
footer_sezione();
fine_stampa();
}
return NEXT_PAGE;
}
@ -112,6 +118,39 @@ void TStampaModificati::filtra_sezioni()
current_cursor()->setregion(da, a);
}
void TStampaModificati::footer_sezione()
{
// stampa totale soggetti appartenenti alla sezione
if (_tipostampa==elenco)
{
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 TStampaModificati::fine_stampa()
{
// stampa totale soggetti a fine stampa
if (_tipostampa==elenco)
{
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
if (_totale > 0 && _totale != _contatore)
{
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _totale);
printer().formfeed();
}
reset_footer();
}
}
void TStampaModificati::set_page(int file, int cnt)
{
switch (_tipostampa)
@ -199,11 +238,14 @@ bool TStampaModificati::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);
}
_contatore++;
_totale++;
}
else
{
@ -240,7 +282,7 @@ void TStampaModificati::header_sezione(const TString16 codsez, const TString16 c
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
if (densot.not_empty())
{
intestazione << "/";
intestazione << densot;
@ -262,6 +304,8 @@ bool TStampaModificati::set_print(int)
_tipostampa = elenco;
_codsez = "**";
_codsez = "**";
_totale = 0;
_contatore = 0;
}
break;
case F_SCHEDE:
@ -288,20 +332,21 @@ bool TStampaModificati::set_print(int)
const TString16 catqua = _msk->get(F_CAT4);
const TString16 catqui = _msk->get(F_CAT5);
const TString16 catses = _msk->get(F_CAT6);
if (catpri.not_empty() && catpri.ok())
if (catpri.not_empty())
_categorie.add((const char*) catpri);
if (catsec.not_empty() && catsec.ok())
if (catsec.not_empty())
_categorie.add((const char*) catsec);
if (catter.not_empty() && catter.ok())
if (catter.not_empty())
_categorie.add((const char*) catter);
if (catqua.not_empty() && catqua.ok())
if (catqua.not_empty())
_categorie.add((const char*) catqua);
if (catqui.not_empty() && catqui.ok())
if (catqui.not_empty())
_categorie.add((const char*) catqui);
if (catses.not_empty() && catses.ok())
if (catses.not_empty())
_categorie.add((const char*) catses);
current_cursor()->set_filterfunction(filter_func_modificati);
reset_print();
reset_print();
printer().footerlen(0);
crea_intestazione();
return TRUE;
}
@ -345,6 +390,7 @@ void TStampaModificati::crea_intestazione()
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro");
set_header(5,"@0gTessera@49gCAP/Località/Comune/Prov.@116gTelefono altro");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------");
printer().footerlen(3);
}
}

View File

@ -39,7 +39,7 @@ class TStampaIscritti : public TPrintapp
TParagraph_string _cognome_nome;
TDate _data_stampa;
ts _tipostampa;
int _contatore;
int _contatore, _totale;
TString16 _codsez, _codsot;
char _tipo_iscdim; // iscritti o dimessi
TDate _dataini, _datafin;
@ -60,6 +60,7 @@ public:
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
void footer_sezione();
void fine_stampa();
TMask& app_mask() { return *_msk; }
TStampaIscritti() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
@ -192,7 +193,8 @@ bool TStampaIscritti::preprocess_page(int file, int counter)
if (_tipostampa==etichette)
if (printer().rows_left() < _form_eti->get_body().height())
printer().formfeed();
_contatore++;
_contatore++;
_totale++;
return TRUE;
}
@ -200,19 +202,41 @@ print_action TStampaIscritti::postprocess_print(int file, int counter)
{
if (_contatore > 0)
footer_sezione();
fine_stampa();
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();
if (_tipostampa==elenco)
{
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::fine_stampa()
{
// stampa totale soggetti a fine stampa
if (_tipostampa==elenco)
{
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
if (_totale > 0 && _totale != _contatore)
{
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _totale);
printer().formfeed();
}
reset_footer();
}
}
void TStampaIscritti::header_sezione(const TString16 codsez, const TString16 codsot)
@ -226,7 +250,7 @@ void TStampaIscritti::header_sezione(const TString16 codsez, const TString16 cod
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
if (densot.not_empty())
{
intestazione << "/";
intestazione << densot;
@ -251,6 +275,7 @@ bool TStampaIscritti::set_print(int m)
_codsez = "**";
_codsot = "**";
_contatore = 0;
_totale = 0;
}
break;
case F_ETICHETTE:
@ -271,17 +296,17 @@ bool TStampaIscritti::set_print(int m)
const TString16 catqua = _msk->get(F_CAT4);
const TString16 catqui = _msk->get(F_CAT5);
const TString16 catses = _msk->get(F_CAT6);
if (catpri.not_empty() && catpri.ok())
if (catpri.not_empty())
_categorie.add((const char*) catpri);
if (catsec.not_empty() && catsec.ok())
if (catsec.not_empty())
_categorie.add((const char*) catsec);
if (catter.not_empty() && catter.ok())
if (catter.not_empty())
_categorie.add((const char*) catter);
if (catqua.not_empty() && catqua.ok())
if (catqua.not_empty())
_categorie.add((const char*) catqua);
if (catqui.not_empty() && catqui.ok())
if (catqui.not_empty())
_categorie.add((const char*) catqui);
if (catses.not_empty() && catses.ok())
if (catses.not_empty())
_categorie.add((const char*) catses);
// filtro per iscritti/dimessi e date
_tipo_iscdim = _msk->get(F_TIPO)[0];

View File

@ -39,7 +39,7 @@ class TStampaNonDon : public TPrintapp
TEti_nondon_form* _form_eti;
TAssoc_array _categorie;
int _cur;
int _contatore;
int _contatore, _totale;
TParagraph_string _cognome_nome, _dencom;
TDate _data_stampa;
TDate _data,_data2;
@ -61,6 +61,7 @@ public:
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
void footer_sezione();
void fine_stampa();
TMask& app_mask() { return *_msk; }
TStampaNonDon() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
@ -216,7 +217,7 @@ void TStampaNonDon::header_sezione(const TString16 codsez, const TString16 codso
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
if (densot.not_empty())
{
intestazione << "/";
intestazione << densot;
@ -232,13 +233,34 @@ void TStampaNonDon::header_sezione(const TString16 codsez, const TString16 codso
void TStampaNonDon::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();
if (_tipostampa==elenco)
{
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 TStampaNonDon::fine_stampa()
{
// stampa totale soggetti a fine stampa
if (_tipostampa==elenco)
{
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
if (_totale > 0 && _totale != _contatore)
{
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _totale);
printer().formfeed();
}
reset_footer();
}
}
bool TStampaNonDon::preprocess_page(int file, int counter)
@ -282,6 +304,7 @@ bool TStampaNonDon::preprocess_page(int file, int counter)
if (printer().rows_left() < _form_eti->get_body().height())
printer().formfeed();
_contatore++;
_totale++;
return TRUE;
}
@ -289,6 +312,7 @@ print_action TStampaNonDon::postprocess_print(int file, int counter)
{
if (_contatore > 0)
footer_sezione();
fine_stampa();
return NEXT_PAGE;
}
@ -306,6 +330,8 @@ bool TStampaNonDon::set_print(int m)
_tipostampa = elenco;
_codsez = "**";
_codsot = "**";
_contatore = 0;
_totale = 0;
}
break;
case F_ETICHETTE:
@ -314,7 +340,6 @@ bool TStampaNonDon::set_print(int m)
}
if (_tipostampa != undefined)
{
_contatore = 0;
reset_files();
add_file(LF_SOGGETTI);
filtra_sezioni();
@ -332,17 +357,17 @@ bool TStampaNonDon::set_print(int m)
const TString16 catqua = _msk->get(F_CAT4);
const TString16 catqui = _msk->get(F_CAT5);
const TString16 catses = _msk->get(F_CAT6);
if (catpri.not_empty() && catpri.ok())
if (catpri.not_empty())
_categorie.add((const char*) catpri);
if (catsec.not_empty() && catsec.ok())
if (catsec.not_empty())
_categorie.add((const char*) catsec);
if (catter.not_empty() && catter.ok())
if (catter.not_empty())
_categorie.add((const char*) catter);
if (catqua.not_empty() && catqua.ok())
if (catqua.not_empty())
_categorie.add((const char*) catqua);
if (catqui.not_empty() && catqui.ok())
if (catqui.not_empty())
_categorie.add((const char*) catqui);
if (catses.not_empty() && catses.ok())
if (catses.not_empty())
_categorie.add((const char*) catses);
current_cursor()->set_filterfunction (filter_func_nondon);
reset_print();
@ -358,13 +383,13 @@ void TStampaNonDon::crea_intestazione()
reset_header();
if (_tipostampa == elenco)
{
printer().footerlen(5);
printer().footerlen(3);
TString sep(132);
sep = "SOGGETTI CHE NON DONANO DAL ";
sep = "NON DONANO DAL ";
if (_data.ok())
sep << _data.string();
if (_data2.ok())
sep << " MA CON ULT.DON. NON PRECEDENTE AL " << _data2.string();
sep << " ULT.DON. NON PRIMA DEL " << _data2.string();
if (_stampa80)
sep.center_just(80);
else

View File

@ -52,7 +52,7 @@ class TFrequenza : public TPrintapp
TString16 _codsez, _codsot;
int _etlarghezza, _etcolonne;
bool _stampa80, _ctrltotale;
int _contatore;
int _contatore, _totale;
char _condizione;
protected:
@ -68,6 +68,7 @@ public:
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
void footer_sezione();
void fine_stampa();
TMask& app_mask() { return *_msk; }
TFrequenza() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50), _numdonsog("",5), _dataultdon("",10) {}
};
@ -229,7 +230,7 @@ void TFrequenza::header_sezione(const TString16 codsez, const TString16 codsot)
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
if (densot.not_empty())
{
intestazione << "/";
intestazione << densot;
@ -313,7 +314,8 @@ bool TFrequenza::preprocess_page(int file, int counter)
if (_tipostampa==etichette)
if (printer().rows_left() < _form_eti->get_body().height())
printer().formfeed();
_contatore++;
_contatore++;
_totale++;
return TRUE;
}
@ -321,19 +323,41 @@ print_action TFrequenza::postprocess_print(int file, int counter)
{
if (_contatore > 0)
footer_sezione();
fine_stampa();
return NEXT_PAGE;
}
void TFrequenza::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();
if (_tipostampa==elenco)
{
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 TFrequenza::fine_stampa()
{
// stampa totale soggetti a fine stampa
if (_tipostampa==elenco)
{
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
if (_totale > 0 && _totale != _contatore)
{
set_footer(3,"TOTALE SOGGETTI STAMPATI %d", _totale);
printer().formfeed();
}
reset_footer();
}
}
bool TFrequenza::set_print(int m)
@ -350,6 +374,8 @@ bool TFrequenza::set_print(int m)
_tipostampa = elenco;
_codsez = "**";
_codsot = "**";
_contatore = 0;
_totale = 0;
}
break;
case F_ETICHETTE:
@ -377,17 +403,17 @@ bool TFrequenza::set_print(int m)
const TString16 catqua = _msk->get(F_CAT4);
const TString16 catqui = _msk->get(F_CAT5);
const TString16 catses = _msk->get(F_CAT6);
if (catpri.not_empty() && catpri.ok())
if (catpri.not_empty())
_categorie.add((const char*) catpri);
if (catsec.not_empty() && catsec.ok())
if (catsec.not_empty())
_categorie.add((const char*) catsec);
if (catter.not_empty() && catter.ok())
if (catter.not_empty())
_categorie.add((const char*) catter);
if (catqua.not_empty() && catqua.ok())
if (catqua.not_empty())
_categorie.add((const char*) catqua);
if (catqui.not_empty() && catqui.ok())
if (catqui.not_empty())
_categorie.add((const char*) catqui);
if (catses.not_empty() && catses.ok())
if (catses.not_empty())
_categorie.add((const char*) catses);
current_cursor()->set_filterfunction (filter_func_freq);
reset_print();