Stampa soggetti non residenti nel comune della sezione di appartenenza:

totale a fine sezione o comune
Patch level         :
Files correlati     :
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/trunk@6397 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 1998-03-20 13:34:51 +00:00
parent 0beb0c6b70
commit 440733c8a6

View File

@ -24,6 +24,7 @@ class TStampaNonDom : public TPrintapp
TDate _data_stampa;
TString16 _codsez, _codsot, _codcom;
TString16 _tipostampa;
int _contatore;
protected:
virtual bool user_create();
@ -37,6 +38,7 @@ public:
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
void header_comune(const TString16 codcom);
void footer_stampa();
TMask& app_mask() { return *_msk; }
TStampaNonDom() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
@ -120,13 +122,13 @@ void TStampaNonDom::header_sezione(const TString16 codsez, const TString16 codso
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << codsez;
intestazione << "/";
intestazione << '/';
intestazione << codsot;
intestazione << " ";
intestazione << ' ';
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << '/';
intestazione << densot;
}
intestazione.center_just();
@ -136,39 +138,57 @@ void TStampaNonDom::header_sezione(const TString16 codsez, const TString16 codso
void TStampaNonDom::header_comune(const TString16 codcom)
{
const TString80 dencom = current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
TString80 dencom = current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
dencom << ' ';
dencom << current_cursor()->curr(LF_COMUNI).get(COM_PROVCOM);
TString intestazione(132);
intestazione = "Comune: ";
intestazione << codcom;
intestazione << " ";
intestazione << ' ';
intestazione << dencom;
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
return;
}
void TStampaNonDom::footer_stampa()
{
// stampa totale soggetti a fine pagina
if (_contatore > 0)
{
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(1, (const char *) sep);
set_footer(2,"TOTALE %d", _contatore);
printer().formfeed();
reset_footer();
}
}
bool TStampaNonDom::preprocess_page(int file, int counter)
{
TRectype& recsog = current_cursor()->curr();
TString80 nome = recsog.get(SOG_COGNOME);
nome << " ";
nome << ' ';
nome << recsog.get(SOG_NOME);
_cognome_nome = nome;
TString256 localita = "";
localita << current_cursor()->curr(-ALIAS_LCP).get("S6");
if (localita.not_empty() && localita.ok())
{
localita << " ";
localita << ' ';
localita << current_cursor()->curr(-ALIAS_LCP).get("S0");
localita << " - ";
}
else
{
localita = current_cursor()->curr(LF_COMUNI).get(COM_CAPCOM);
localita << " ";
localita << ' ';
}
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
localita << ' ';
localita << current_cursor()->curr(LF_COMUNI).get(COM_PROVCOM);
localita.trim();
_dencom = localita;
// salto pagina se cambio sezione o comune
@ -179,7 +199,9 @@ bool TStampaNonDom::preprocess_page(int file, int counter)
if ((_codsez!=codsez)||(_codsot!=codsot))
{
if (_codsez != "**")
printer().formfeed();
//printer().formfeed();
footer_stampa();
_contatore = 0;
_codsez = codsez;
_codsot = codsot;
header_sezione(codsez, codsot);
@ -191,12 +213,14 @@ bool TStampaNonDom::preprocess_page(int file, int counter)
if (_codcom!=codcom)
{
if (_codcom != "**")
printer().formfeed();
//printer().formfeed();
footer_stampa();
_contatore = 0;
_codcom = codcom;
header_comune(codcom);
}
}
_contatore++;
if (printer().rows_left()<3)
printer().formfeed();
return TRUE;
@ -208,6 +232,7 @@ bool TStampaNonDom::set_print(int m)
tasto = _msk->run();
if (tasto == K_ENTER)
{
_contatore = 0;
_codsez = "**";
_codsot = "**";
_codcom = "****";
@ -286,6 +311,7 @@ void TStampaNonDom::crea_intestazione()
set_header(5,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro");
set_header(6,"@49gCAP/Località/Comune/Prov.@116gTelefono altro");
set_header(7,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------");
printer().footerlen(3);
}
bool TStampaNonDom::user_create()