Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : Stampe soggetti: configurazione stampante per etichette + totale soggetti per sezione


git-svn-id: svn://10.65.10.50/trunk@7697 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 1999-01-26 14:07:30 +00:00
parent a615320d1f
commit 34f0b7cd93
2 changed files with 73 additions and 12 deletions

View File

@ -8,6 +8,7 @@
#include "at2.h"
#include "at2800a.h"
#include "atlib.h"
#define ALIAS_LCP 100
#define ALIAS_TCS 200
@ -37,6 +38,7 @@ class TStampaNonDon : public TPrintapp
TEti_nondon_form* _form_eti;
TAssoc_array _categorie;
int _cur;
int _contatore;
TParagraph_string _cognome_nome, _dencom;
TDate _data_stampa;
TDate _data;
@ -51,11 +53,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; }
TStampaNonDon() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
@ -207,6 +211,18 @@ void TStampaNonDon::header_sezione(const TString16 codsez, const TString16 codso
return;
}
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();
}
bool TStampaNonDon::preprocess_page(int file, int counter)
{
if (_tipostampa == elenco)
@ -239,36 +255,51 @@ bool TStampaNonDon::preprocess_page(int file, int counter)
if ((_codsez!=codsez)||(_codsot!=codsot))
{
if (_codsez != "**")
printer().formfeed();
//printer().formfeed();
footer_sezione();
_codsez = codsez;
_codsot = codsot;
_contatore = 0;
header_sezione(codsez, codsot);
}
}
if (_tipostampa==etichette)
if (printer().rows_left() < _form_eti->get_body().height())
printer().formfeed();
_contatore++;
return TRUE;
}
print_action TStampaNonDon::postprocess_print(int file, int counter)
{
if (_contatore > 0)
footer_sezione();
return NEXT_PAGE;
}
bool TStampaNonDon::set_print(int m)
{
TPrinter& p = printer();
p.read_configuration();
_tipostampa = undefined;
KEY tasto;
tasto = _msk->run();
switch (tasto)
{
case F_ELENCO:
{
_tipostampa = elenco;
_codsez = "**";
_codsot = "**";
break;
}
break;
case F_ETICHETTE:
_tipostampa = etichette;
break;
_tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
break;
}
if (_tipostampa != undefined)
{
{
_contatore = 0;
reset_files();
add_file(LF_SOGGETTI);
filtra_sezioni();
@ -310,7 +341,8 @@ void TStampaNonDon::crea_intestazione()
{
reset_header();
if (_tipostampa == elenco)
{
{
printer().footerlen(5);
TString sep(132);
sep = "ELENCO SOGGETTI CHE NON DONANO DAL ";
if (app()._data.ok())

View File

@ -11,6 +11,7 @@
#include "at2.h"
#include "at2900a.h"
#include "atlib.h"
#define ALIAS_LCP 100
#define ALIAS_TCS 200
@ -51,6 +52,7 @@ class TFrequenza : public TPrintapp
TString16 _codsez, _codsot;
int _etlarghezza, _etcolonne;
bool _stampa80;
int _contatore;
protected:
virtual bool user_create();
@ -58,13 +60,14 @@ 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; }
TFrequenza() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50), _numdonsog("",5), _dataultdon("",10) {}
};
@ -279,7 +282,8 @@ bool TFrequenza::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);
@ -288,24 +292,48 @@ bool TFrequenza::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 TFrequenza::postprocess_print(int file, int counter)
{
if (_contatore > 0)
footer_sezione();
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();
}
bool TFrequenza::set_print(int m)
{
TPrinter& p = printer();
p.read_configuration();
_tipostampa = undefined;
KEY tasto;
tasto = _msk->run();
switch (tasto)
{
case F_ELENCO:
{
_tipostampa = elenco;
_codsez = "**";
_codsot = "**";
break;
}
break;
case F_ETICHETTE:
_tipostampa = etichette;
break;
_tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
break;
}
if (_tipostampa != undefined)
{
@ -337,6 +365,7 @@ bool TFrequenza::set_print(int m)
_categorie.add((const char*) catses);
current_cursor()->set_filterfunction (filter_func_freq);
reset_print();
printer().footerlen(0);
crea_intestazione();
return TRUE;
}
@ -379,7 +408,6 @@ void TFrequenza::crea_intestazione()
set_header(6,"@0gCateg.@9gNato il@44gTelefono altro");
set_header(7,"@0g--------@9g----------------------------------@44g--------------@60g----------");
_cognome_nome.set_width(35);
}
else
{
@ -388,6 +416,7 @@ void TFrequenza::crea_intestazione()
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------@132g----------");
_cognome_nome.set_width(25);
}
printer().footerlen(3);
}
}