Patch level : 12.00 1378
Files correlati : ca3.exe Bug : Commento: Sistemata creazione file temporaneo nei book e report_book
This commit is contained in:
parent
600296473a
commit
6adaae309c
@ -1908,13 +1908,13 @@ bool TBook::export_dbase(TFilename& fname, TTrec * desc, bool signature, bool go
|
|||||||
FOR_EACH_STR_TOKEN(line, val)
|
FOR_EACH_STR_TOKEN(line, val)
|
||||||
if (*desc->rec().Fd[i].Name != '\0')
|
if (*desc->rec().Fd[i].Name != '\0')
|
||||||
switch (desc->rec().Fd[i].TypeF)
|
switch (desc->rec().Fd[i].TypeF)
|
||||||
{
|
{
|
||||||
case _alfafld:
|
case _alfafld:
|
||||||
case _charfld:
|
case _charfld:
|
||||||
case _boolfld:
|
case _boolfld:
|
||||||
case _memofld:
|
case _memofld:
|
||||||
dbf.put(desc->rec().Fd[i++].Name, val);
|
dbf.put(desc->rec().Fd[i++].Name, val);
|
||||||
break;
|
break;
|
||||||
case _intfld :
|
case _intfld :
|
||||||
case _longfld :
|
case _longfld :
|
||||||
case _realfld :
|
case _realfld :
|
||||||
@ -1922,12 +1922,12 @@ bool TBook::export_dbase(TFilename& fname, TTrec * desc, bool signature, bool go
|
|||||||
case _intzerofld :
|
case _intzerofld :
|
||||||
case _longzerofld :
|
case _longzerofld :
|
||||||
dbf.put(desc->rec().Fd[i++].Name, real::ita2eng(val));
|
dbf.put(desc->rec().Fd[i++].Name, real::ita2eng(val));
|
||||||
break;
|
break;
|
||||||
case _datefld :
|
case _datefld :
|
||||||
dbf.put(desc->rec().Fd[i++].Name, TDate(atoi(val.left(2)), atoi(val.mid(3,2)), 2000 + atoi(val.right(2))));
|
dbf.put(desc->rec().Fd[i++].Name, TDate(atoi(val.left(2)), atoi(val.mid(3,2)), 2000 + atoi(val.right(2))));
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dbf.write();
|
dbf.write();
|
||||||
}
|
}
|
||||||
@ -2582,16 +2582,16 @@ bool TBook::print_or_preview()
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
TBook::TBook(const char* name)
|
TBook::TBook(const char* title, const char * pref)
|
||||||
: _out(NULL), _is_temporary(false), _max_frame(0,0),
|
: _out(nullptr), _title(title), _is_temporary(false), _max_frame(0,0),
|
||||||
_pages(0), _page(0), _rcd(NULL), _printwin(NULL), _page_is_open(false)
|
_pages(0), _page(0), _rcd(nullptr), _printwin(nullptr), _page_is_open(false)
|
||||||
{
|
{
|
||||||
_file = name;
|
TString prefix(pref);
|
||||||
if (_file.blank())
|
|
||||||
{
|
if (prefix.blank())
|
||||||
_file.temp("rep", "rap");
|
prefix = "rep";
|
||||||
_is_temporary = true;
|
_file.temp(prefix, "rap");
|
||||||
}
|
_is_temporary = true;
|
||||||
ofstream out(_file);
|
ofstream out(_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3073,11 +3073,14 @@ bool TReport_book::add(TReport& rep, export_type type, bool progind)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
TRecordset* rex = _report->recordset();
|
TRecordset* rex = _report->recordset();
|
||||||
|
|
||||||
if (rex == nullptr)
|
if (rex == nullptr)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
rex->requery();
|
rex->requery();
|
||||||
|
|
||||||
const TRecnotype rex_items = rex->items();
|
const TRecnotype rex_items = rex->items();
|
||||||
|
|
||||||
if (rex_items <= 0)
|
if (rex_items <= 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -3336,6 +3339,6 @@ bool TReport_book::on_link(const TReport_link& lnk)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
TReport_book::TReport_book(const char* name)
|
TReport_book::TReport_book(const char* title, const char * pref)
|
||||||
: TBook(name), _report(NULL)
|
: TBook(title, pref), _report(nullptr)
|
||||||
{ }
|
{ }
|
||||||
|
@ -11,6 +11,7 @@ class TBook : public TObject
|
|||||||
{
|
{
|
||||||
size_t _page, _pages;
|
size_t _page, _pages;
|
||||||
|
|
||||||
|
TString _title;
|
||||||
TFilename _file, _pdf_file; // Nomi dei file di output
|
TFilename _file, _pdf_file; // Nomi dei file di output
|
||||||
|
|
||||||
ofstream* _out; // File di output
|
ofstream* _out; // File di output
|
||||||
@ -58,7 +59,8 @@ public:
|
|||||||
virtual bool close_page();
|
virtual bool close_page();
|
||||||
virtual bool main_loop();
|
virtual bool main_loop();
|
||||||
|
|
||||||
virtual const TFilename & file() const { return _file;}
|
virtual const TString & title() const { return _title; }
|
||||||
|
virtual const TFilename & file() const { return _file; }
|
||||||
virtual void set_pen(COLOR color, int width = 0, PEN_STYLE style = P_SOLID);
|
virtual void set_pen(COLOR color, int width = 0, PEN_STYLE style = P_SOLID);
|
||||||
virtual void set_brush(COLOR color, PAT_STYLE pattern = PAT_SOLID, int shade_angle = 0);
|
virtual void set_brush(COLOR color, PAT_STYLE pattern = PAT_SOLID, int shade_angle = 0);
|
||||||
virtual void set_font(const TReport_font& font);
|
virtual void set_font(const TReport_font& font);
|
||||||
@ -106,7 +108,7 @@ public:
|
|||||||
virtual bool esporta();
|
virtual bool esporta();
|
||||||
bool print_or_preview(); // Calls one of the above
|
bool print_or_preview(); // Calls one of the above
|
||||||
|
|
||||||
TBook(const char* name);
|
TBook(const char* title = "", const char * pref = "");
|
||||||
virtual ~TBook();
|
virtual ~TBook();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -144,7 +146,7 @@ public:
|
|||||||
virtual int logical_page_height() const { return _logical_page_height; }
|
virtual int logical_page_height() const { return _logical_page_height; }
|
||||||
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, word copies = 0);
|
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, word copies = 0);
|
||||||
virtual bool archive(const char* repname, bool signature);
|
virtual bool archive(const char* repname, bool signature);
|
||||||
TReport_book(const char* name = NULL);
|
TReport_book(const char* title = "", const char * pref = "");
|
||||||
};
|
};
|
||||||
|
|
||||||
bool advanced_set_draw_tools(TWindow& win, PAT_STYLE pat, int border, COLOR fore, COLOR back);
|
bool advanced_set_draw_tools(TWindow& win, PAT_STYLE pat, int border, COLOR fore, COLOR back);
|
||||||
|
@ -220,9 +220,11 @@ public:
|
|||||||
// @cmember Permette di trovare il plurale di una stringa
|
// @cmember Permette di trovare il plurale di una stringa
|
||||||
TString& add_plural(long num, const char * name);
|
TString& add_plural(long num, const char * name);
|
||||||
|
|
||||||
// @cmember Assegna la stringa passata con indirizzo
|
// @cmember Azzera la stringa
|
||||||
const TString& operator =(const TString& s)
|
const TString& reset() { return cut(0); }
|
||||||
{ return set(s._str); }
|
// @cmember Assegna la stringa passata con indirizzo
|
||||||
|
const TString& operator =(const TString& s)
|
||||||
|
{ return set(s._str); }
|
||||||
// @cmember Assegna la stringa passata
|
// @cmember Assegna la stringa passata
|
||||||
const TString& operator =(const char* s)
|
const TString& operator =(const char* s)
|
||||||
{ return set(s); }
|
{ return set(s); }
|
||||||
@ -684,8 +686,6 @@ public:
|
|||||||
void destroy(int pos);
|
void destroy(int pos);
|
||||||
// @cmember Toglie la stringa di posizione pos e la ritorna
|
// @cmember Toglie la stringa di posizione pos e la ritorna
|
||||||
const char* remove(int pos);
|
const char* remove(int pos);
|
||||||
// @cmember Azzera la stringa
|
|
||||||
void reset() { cut(0); }
|
|
||||||
|
|
||||||
// @cmember Ritorna il prossimo token
|
// @cmember Ritorna il prossimo token
|
||||||
const char* get();
|
const char* get();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user