Corretto errore 5906. Aggiunta la possibilita' di stampare campi composti.
git-svn-id: svn://10.65.10.50/trunk@3458 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b5fa5a44c0
commit
588282acc0
@ -24,8 +24,8 @@ class BA3200_application : public TPrintapp
|
|||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
TString _maskname;
|
TString _maskname;
|
||||||
int _logicnum;
|
int _logicnum;
|
||||||
TString_array _string_roman;
|
TString_array _string_roman, _string_compound;
|
||||||
TString_array _field_roman;
|
TString_array _field_roman, _field_compound;
|
||||||
bool _stampa_registri;
|
bool _stampa_registri;
|
||||||
bool _stampa_ca7; //tabella causali 770
|
bool _stampa_ca7; //tabella causali 770
|
||||||
bool _tabella_comune;
|
bool _tabella_comune;
|
||||||
@ -91,6 +91,8 @@ void BA3200_application::set_page (int , int )
|
|||||||
{
|
{
|
||||||
_string_roman.destroy();
|
_string_roman.destroy();
|
||||||
_field_roman.destroy();
|
_field_roman.destroy();
|
||||||
|
_string_compound.destroy();
|
||||||
|
_field_compound.destroy();
|
||||||
set_rows();
|
set_rows();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,6 +112,37 @@ bool BA3200_application::preprocess_page(int , int)
|
|||||||
s = itor(n);
|
s = itor(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int compound = _field_compound.items();
|
||||||
|
if (compound > 0)
|
||||||
|
// Scorre le righe settate
|
||||||
|
for (int i = 0; i < compound; i++)
|
||||||
|
{
|
||||||
|
TToken_string f(_field_compound.row(i),'+'); // campo composto
|
||||||
|
TString& s = _string_compound.row(i); // riga da stampare
|
||||||
|
s.cut(0); // Reset the row...
|
||||||
|
bool compile_row = TRUE;
|
||||||
|
const int cmp_items = f.items();
|
||||||
|
// Scorre gli elementi della riga
|
||||||
|
for (int j = 0; j < cmp_items; j++)
|
||||||
|
{
|
||||||
|
// compone la stringa totale
|
||||||
|
TString xx(f.get(j));
|
||||||
|
if (xx[0] != '"') // se non e' una costante stringa legge il valore
|
||||||
|
{
|
||||||
|
TFieldref fld(xx,0);
|
||||||
|
xx = fld.read(*_rel);
|
||||||
|
if (xx.empty()) compile_row = FALSE;
|
||||||
|
else compile_row = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xx.ltrim(1);xx.rtrim(1);
|
||||||
|
}
|
||||||
|
if (compile_row)
|
||||||
|
s << xx; // appende alla stringa il valore ricavato (se il campo e' vuoto non appende nemmeno la stringa fissa)
|
||||||
|
}
|
||||||
|
}
|
||||||
// Stampa tabella registri. Calcolo: pagine residue = pagine - stampate
|
// Stampa tabella registri. Calcolo: pagine residue = pagine - stampate
|
||||||
if (_stampa_registri)
|
if (_stampa_registri)
|
||||||
{
|
{
|
||||||
@ -227,20 +260,26 @@ void BA3200_application::set_rows()
|
|||||||
{
|
{
|
||||||
riga_record = line.get_int();
|
riga_record = line.get_int();
|
||||||
|
|
||||||
TString s(line.get());
|
|
||||||
|
|
||||||
campo = s;
|
TString s(line.get());
|
||||||
from = campo.from();
|
int logicnum = _logicnum;
|
||||||
to = campo.to();
|
const bool is_compound = s.find('+') >= 0; // Controlla se e' una stringa composta (usare #t nel formato)
|
||||||
name = campo.name();
|
if (!is_compound)
|
||||||
int logicnum = campo.file() == 0 ? _logicnum : campo.file();
|
{
|
||||||
|
campo = s;
|
||||||
|
from = campo.from();
|
||||||
|
to = campo.to();
|
||||||
|
name = campo.name();
|
||||||
|
if (campo.file != 0)
|
||||||
|
logicnum = campo.file();
|
||||||
|
}
|
||||||
|
|
||||||
formato_campo = line.get();
|
formato_campo = line.get();
|
||||||
formato_campo.trim();
|
formato_campo.trim();
|
||||||
formato_campo.lower();
|
formato_campo.lower();
|
||||||
const int p = formato_campo.find("@m");
|
const int p = formato_campo.find("@m");
|
||||||
|
|
||||||
if (p != -1)
|
if (p != -1 && !is_compound)
|
||||||
{
|
{
|
||||||
formato_campo.cut(p);
|
formato_campo.cut(p);
|
||||||
formato_campo << "#t";
|
formato_campo << "#t";
|
||||||
@ -250,7 +289,7 @@ void BA3200_application::set_rows()
|
|||||||
|
|
||||||
set_row (riga_record, formato_campo, _string_roman.objptr(last));
|
set_row (riga_record, formato_campo, _string_roman.objptr(last));
|
||||||
}
|
}
|
||||||
else
|
else if (!is_compound)
|
||||||
{
|
{
|
||||||
if (formato_campo.find("@pn"))
|
if (formato_campo.find("@pn"))
|
||||||
picture = line.get();
|
picture = line.get();
|
||||||
@ -265,7 +304,14 @@ void BA3200_application::set_rows()
|
|||||||
else
|
else
|
||||||
set_row (riga_record, formato_campo, FLD(logicnum,name,from,to) );
|
set_row (riga_record, formato_campo, FLD(logicnum,name,from,to) );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_string_compound.add("");
|
||||||
|
_field_compound.add(s);
|
||||||
|
const int last = _string_compound.items() - 1;
|
||||||
|
|
||||||
|
set_row (riga_record, formato_campo, _string_compound.objptr(last));
|
||||||
|
}
|
||||||
line = (const char *) rpt.line();
|
line = (const char *) rpt.line();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,16 +9,15 @@ Tabella Banche
|
|||||||
1|@26g%s|Istituto
|
1|@26g%s|Istituto
|
||||||
1|@78g%s|Dipendenza
|
1|@78g%s|Dipendenza
|
||||||
2|@26g%s|Indirizzo
|
2|@26g%s|Indirizzo
|
||||||
3|@26g%s|CAP
|
4|@26g%s|CAP
|
||||||
3|@32g%s|Comune
|
4|@32g%s|Comune
|
||||||
|
|
||||||
[Rows]
|
[Rows]
|
||||||
1|CODTAB[1,5]|@7g@5s
|
1|CODTAB[1,5]|@7g@5s
|
||||||
1|CODTAB[6,10]|@19g@5s
|
1|CODTAB[6,10]|@19g@5s
|
||||||
1|S0|@26g@50,ls
|
1|S0|@26g@50,ls
|
||||||
1|I0|@78g@4n
|
1|I0|@78g@4n
|
||||||
2|S2|@26g@40,ls
|
2|S2+", "+S7|@26g#-40t
|
||||||
2|S7|@68g@10,ls
|
3|S3|@26g@10,ls
|
||||||
3|S3|@26g@5,ls
|
3|LF_COMUNI->DENCOM+" ("+LF_COMUNI->PROVCOM+")"|@32g#-55t
|
||||||
3|S5|@32g@4,ls
|
|
||||||
3|LF_COMUNI->DENCOM|@38g@50,ls
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user