Gestione default del campo F_COLANNO sulla maschera di stampa
Correzione errorini di tmpfile git-svn-id: svn://10.65.10.50/trunk@5363 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
178ee3952b
commit
327cac43fb
@ -363,7 +363,7 @@ private:
|
||||
void set_ragg_per_um();
|
||||
bool filtro_chiavi(TSVriep_record &curr);
|
||||
void update_file(const char * key, const char * code,const char tipo, const int level, const int col, TSVriep_record& curr);
|
||||
void genera_file(TLocalisamfile *f);
|
||||
void genera_file(const char *outfn);
|
||||
|
||||
// handler per i campi di maschera
|
||||
static bool chiave_notify(TSheet_field& f, int r, KEY k);
|
||||
@ -458,10 +458,10 @@ bool TStampa_stat::set_print(int i)
|
||||
|
||||
_st_totr=printmask().get_bool(F_STTOTALIRIGA);
|
||||
_st_totc=printmask().get_bool(F_STTOTALICOL);
|
||||
_col_anno =selmask().get_int(F_COL_ANNO); //numero di colonne che formano un "Anno"
|
||||
_largcol = (_st_totr ? LARG_COLPERC : 0 ) + (selmask().get(F_TIPODATO)[0]=='V' ? LARG_COLVAL : LARG_COLQTA); // valori o quantità
|
||||
_numcol_dati = selmask().get_int(F_PERIODO);
|
||||
_numcol = _numcol_dati+int((_numcol_dati -1)/_col_anno+1);
|
||||
_col_anno =min(_numcol_dati,printmask().get_int(F_COLANNO)); //numero di colonne che formano un "Anno"
|
||||
_numcol = _numcol_dati+ (_st_totr ? int((_numcol_dati -1)/_col_anno+1) : 0);
|
||||
_pagewidth=POS_PRIMACOL+int((FORMWIDTH-POS_PRIMACOL)/_largcol)*_largcol;
|
||||
|
||||
// reset delle variabili per la gestione di gruppi ai vari livelli
|
||||
@ -493,7 +493,7 @@ void TStampa_stat::preprocess_footer()
|
||||
|
||||
void TStampa_stat::preprocess_header()
|
||||
{
|
||||
int bkg=0,row=0,lastrow;
|
||||
int bkg=0,col=0,row=0,lastrow;
|
||||
|
||||
// *****************
|
||||
// header
|
||||
@ -512,23 +512,24 @@ void TStampa_stat::preprocess_header()
|
||||
lastrow=row;
|
||||
for (int c=0; c < _numcol; c++) // colonne
|
||||
{
|
||||
if (_st_totr && c && (((c)%_col_anno)==0 || c== _numcol_dati) )
|
||||
if (_st_totr && c && (((c)%_col_anno)==0 || c> _numcol_dati) )
|
||||
{
|
||||
set_row_atpos('H',row,nome_totale(int(c/_col_anno)),POS_PRIMACOL+c*_largcol+_largcol/2 );
|
||||
set_row_atpos('H',row,nome_totale(1+int((c-1)/_col_anno) ),POS_PRIMACOL+c*_largcol+_largcol/2 );
|
||||
} else {
|
||||
wrk_row=nome_colonna1(c);
|
||||
set_row_atpos('H',row,wrk_row,POS_PRIMACOL+c*_largcol+(_largcol-wrk_row.len())/2 );
|
||||
wrk_row=nome_colonna2(c);
|
||||
wrk_row=nome_colonna1(col);
|
||||
set_row_atpos('H',row,wrk_row,POS_PRIMACOL+c*_largcol );
|
||||
wrk_row=nome_colonna2(col);
|
||||
if (wrk_row.not_empty())
|
||||
{
|
||||
lastrow=row+1;
|
||||
set_row_atpos('H',row+1,wrk_row,POS_PRIMACOL+c*_largcol+(_largcol-wrk_row.len())/2 );
|
||||
set_row_atpos('H',row+1,wrk_row,POS_PRIMACOL+c*_largcol);
|
||||
}
|
||||
col++;
|
||||
}
|
||||
if (_st_totr)
|
||||
{
|
||||
lastrow=row+1;
|
||||
set_row_atpos('H',row+1," Perc.",POS_PRIMACOL+(c+1)*_largcol-LARG_COLPERC);
|
||||
set_row_atpos('H',row+1,"Perc.",POS_PRIMACOL+(c+1)*_largcol-LARG_COLPERC+1);
|
||||
}
|
||||
}
|
||||
row=lastrow;
|
||||
@ -558,7 +559,7 @@ const TString& TStampa_stat::nome_colonna1(int c)
|
||||
if (code_freq==selmask().get(F_FREQUENZA)[0])
|
||||
{
|
||||
// numerico; può essere un qualsiasi multiplo della freq
|
||||
s_park.format("%s %d-%d %d",(const char *)char2freqname(code_freq),1+(start+c*numero-1)%lastp , 1+(start+(c+1)*numero-2)%lastp,din.year());
|
||||
s_park.format("%s %d-%d",(const char *)char2freqname(code_freq),1+(start+c*numero-1)%lastp , 1+(start+(c+1)*numero-2)%lastp);
|
||||
} else {
|
||||
switch (code_freq)
|
||||
{
|
||||
@ -567,6 +568,7 @@ const TString& TStampa_stat::nome_colonna1(int c)
|
||||
s_park.format("%d^%s",1+(start+c-1)%lastp,(const char *)char2freqname(code_freq));
|
||||
}
|
||||
}
|
||||
s_park.center_just(_largcol);
|
||||
return s_park;
|
||||
}
|
||||
|
||||
@ -588,6 +590,7 @@ const TString& TStampa_stat::nome_colonna2(int c)
|
||||
s_park.format(" anno %d",din.year()+int((start+c-1)/lastp));
|
||||
}
|
||||
}
|
||||
s_park.center_just(LARG_COLVAL);
|
||||
return s_park;
|
||||
}
|
||||
|
||||
@ -939,20 +942,18 @@ bool TStampa_stat::menu(MENU_TAG )
|
||||
set_ragg_per_um();
|
||||
if (expmask().run()!=K_ESC)
|
||||
{
|
||||
TFilename fn(expmask().get(F_FILENAME));
|
||||
TIsamtempfile * f=new TIsamtempfile(LF_SVSTAT,fn,TRUE);
|
||||
genera_file(f);
|
||||
TFilename fname(expmask().get(F_FILENAME));
|
||||
fname.insert("%");
|
||||
genera_file(fname);
|
||||
}
|
||||
} else {
|
||||
TFilename fn;
|
||||
fn.temp();
|
||||
fn.insert("%");
|
||||
genera_file(new TIsamtempfile(LF_SVSTAT,fn,TRUE));
|
||||
TFilename fname("svs");
|
||||
genera_file(fname);
|
||||
TIsamtempfile * f = new TIsamtempfile(LF_SVSTAT,fname,FALSE,TRUE);
|
||||
set_printmask();
|
||||
TIsamtempfile * f=new TIsamtempfile(LF_SVSTAT,fn,FALSE);
|
||||
f->set_autodel();
|
||||
current_cursor()->relation()->replace(f);
|
||||
do_print(1);
|
||||
current_cursor()->relation()->replace(new TLocalisamfile(LF_SVSTAT));
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
@ -1333,7 +1334,7 @@ void TStampa_stat::set_ragg_per_um()
|
||||
_ragg_per_um=TRUE;
|
||||
}
|
||||
|
||||
void TStampa_stat::genera_file(TLocalisamfile *f)
|
||||
void TStampa_stat::genera_file(const char *outfn)
|
||||
{
|
||||
|
||||
TString key; // chiave per il record del file statistiche
|
||||
@ -1346,7 +1347,7 @@ void TStampa_stat::genera_file(TLocalisamfile *f)
|
||||
|
||||
|
||||
// file di OUTPUT
|
||||
_cache= new TStat_cache(f);
|
||||
_cache= new TStat_cache(new TIsamtempfile(LF_SVSTAT,outfn,TRUE,FALSE));
|
||||
|
||||
// file di INPUT
|
||||
TLocalisamfile riep(LF_SVRIEP);
|
||||
@ -1453,6 +1454,13 @@ void TStampa_stat::set_printmask()
|
||||
printmask().field(F_STRAFFRONTO).show();
|
||||
printmask().field(F_TIPORAFFRONTO).show();
|
||||
}
|
||||
printmask().field(F_COLANNO).set(mp.get(F_COL_ANNO));
|
||||
if (mp.field(F_COL_ANNO).enabled()) // venduto, no progressivo o mobile
|
||||
{
|
||||
printmask().field(F_COLANNO).enable();
|
||||
} else {
|
||||
printmask().field(F_COLANNO).disable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user