diff --git a/ps/pd6342500.cpp b/ps/pd6342500.cpp index 23b1e6306..21ec39481 100755 --- a/ps/pd6342500.cpp +++ b/ps/pd6342500.cpp @@ -62,23 +62,28 @@ class TBilancio_recset : public TCSV_recordset public: TBit_array & tot_rows() { return _tot_rows;} TBit_array & tot_gen() { return _tot_gen;} - virtual bool get_attr(int column, TAttributes & attr) const; + virtual bool get_attr(int column, TAttributes & attr, bool header = false) const; TBilancio_recset(const TMask & m); }; -bool TBilancio_recset::get_attr(int column, TAttributes & attr) const +bool TBilancio_recset::get_attr(int column, TAttributes & attr, bool header) const { const TRecnotype rowno = current_row(); - if (rowno == 0L && column > 1) + if ((rowno == 0L || header)) { - if ((unsigned int) column >= columns() - 1) - attr.set_background(COLOR_RED); + if (column > 1) + { + if ((unsigned int) column >= columns() - 1) + attr.set_background(COLOR_RED); + else + attr.set_background(header_back[_group[column - 2] % 6]); + attr.set_foreground(COLOR_WHITE); + return true; + } else - attr.set_background(header_back[_group[column - 2] % 6]); - attr.set_foreground(COLOR_WHITE); - return true; + return false; } else if (_tot_rows[rowno] || _tot_rows_ind[rowno]) @@ -184,6 +189,7 @@ TBilancio_recset::TBilancio_recset(const TMask & m) : TCSV_recordset("CSV(;)\n") } _group[i] = group; colname = cmskey; + colname.replace('|', '-'); create_column(colname, _realfld); } create_column("Totale", _realfld); @@ -191,8 +197,6 @@ TBilancio_recset::TBilancio_recset(const TMask & m) : TCSV_recordset("CSV(;)\n") TRecnotype sheet_row = new_rec(""); TString descr; - set(0, "Conto"); - set(1, "Descrizione"); for (int c = 0; c < ncols; c++) { cmskey = colkeys.row(c); @@ -201,10 +205,10 @@ TBilancio_recset::TBilancio_recset(const TMask & m) : TCSV_recordset("CSV(;)\n") descr.cut(0); descr << cache().get(LF_COMMESSE, cms, COMMESSE_DESCRIZ); - descr << " - " << cache().get(LF_FASI, cmskey, FASI_DESCRIZ); + descr << "-" << cache().get(LF_FASI, cmskey, FASI_DESCRIZ); set(c + 2, descr); } - set(ncols + 2, "Totale "); + set(ncols + 2, " "); long start_rec = -1; int nrows = rowkeys.items();