Patch level :10.0 196
Files correlati : tutti Ricompilazione Demo : [ ] Commento : 0001045: Aprire excel esportato nei seguenti programmi (vale come regola) asto dx esporta in excel deve aprire l'anteprima nei programmi che hanno un monitor (già succede per le ricerche tabelle) e non aprire la finestra di salvataggio) I programmi per ora (ma per il futuro vale come regola) incriminati sono: Eleco articoli in contratto Passaggi per contratto Visualizzazione e modifica giri Pagina 7 documenti di trasporto git-svn-id: svn://10.65.10.50/trunk@17927 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
fd12442304
commit
883b0df1a1
@ -3414,47 +3414,53 @@ void TSheet_field::set_userput(SHEET_USERGETPUT handler)
|
|||||||
|
|
||||||
bool TSheet_field::esporta() const
|
bool TSheet_field::esporta() const
|
||||||
{
|
{
|
||||||
TFilename name("tabella.xls");
|
TFilename name;
|
||||||
FILE_SPEC fs;
|
name.tempdir();
|
||||||
xvt_fsys_convert_str_to_fspec(name, &fs);
|
name.add(mask().source_file().name_only());
|
||||||
if (xvt_dm_post_file_save(&fs, TR("Selezionare il file di destinazione")))
|
name.ext("xls");
|
||||||
xvt_fsys_convert_fspec_to_str(&fs, name.get_buffer(), name.size());
|
|
||||||
|
|
||||||
if (name.full())
|
ofstream xls(name);
|
||||||
|
const char sep = '\t';
|
||||||
|
TToken_string tab(128, sep);
|
||||||
|
|
||||||
|
TString str;
|
||||||
|
int columns = 0;
|
||||||
|
for (columns = 0; ; columns++)
|
||||||
{
|
{
|
||||||
ofstream xls(name);
|
str = get_column_header(columns);
|
||||||
const char sep = '\t';
|
if (str.not_empty())
|
||||||
TToken_string tab(128, sep);
|
tab.add(str);
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
xls << tab << endl;
|
||||||
|
|
||||||
TString str;
|
for (long n = 0; n < items(); n++)
|
||||||
int columns = 0;
|
{
|
||||||
for (columns = 0; ; columns++)
|
const TToken_string& r = ((TSheet_field*)this)->row(n);
|
||||||
|
tab = r;
|
||||||
|
tab.replace(r.separator(), sep);
|
||||||
|
tab.separator(sep);
|
||||||
|
for (int c = 0; tab.get(c, str); c++)
|
||||||
{
|
{
|
||||||
str = get_column_header(columns);
|
if (real::is_real(str))
|
||||||
if (str.not_empty())
|
{
|
||||||
tab.add(str);
|
if (real::is_null(str))
|
||||||
else
|
str.cut(0);
|
||||||
break;
|
else
|
||||||
|
{
|
||||||
|
if (real::is_natural(str))
|
||||||
|
str.trim();
|
||||||
|
else
|
||||||
|
xvt_str_number_format(str.get_buffer(), str.size());
|
||||||
|
}
|
||||||
|
tab.add(str, c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
xls << tab << endl;
|
xls << tab << endl;
|
||||||
|
|
||||||
for (long n = 0; n < items(); n++)
|
|
||||||
{
|
|
||||||
const TToken_string& r = ((TSheet_field*)this)->row(n);
|
|
||||||
tab = r;
|
|
||||||
tab.replace(r.separator(), sep);
|
|
||||||
tab.separator(sep);
|
|
||||||
for (int c = 0; tab.get(c, str); c++)
|
|
||||||
{
|
|
||||||
if (real::is_real(str))
|
|
||||||
{
|
|
||||||
xvt_str_number_format(str.get_buffer(), str.size());
|
|
||||||
tab.add(str, c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
xls << tab << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
xls.close();
|
||||||
|
xvt_sys_goto_url(name, "open");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -799,8 +799,8 @@ static const TString& bytes2str(long b)
|
|||||||
TString& tmp = get_tmp_string(50);
|
TString& tmp = get_tmp_string(50);
|
||||||
if (b > 0)
|
if (b > 0)
|
||||||
{
|
{
|
||||||
const long mega = 1024*1024;
|
const double mega = 1024*1024;
|
||||||
if (b >= 2*mega)
|
if (b >= mega)
|
||||||
tmp.format("%.2lf MBytes", double(b)/mega);
|
tmp.format("%.2lf MBytes", double(b)/mega);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1291,6 +1291,8 @@ public:
|
|||||||
int add_item(short icon, const char* text, int flags);
|
int add_item(short icon, const char* text, int flags);
|
||||||
bool select(int item, bool on);
|
bool select(int item, bool on);
|
||||||
int selected() const;
|
int selected() const;
|
||||||
|
int items() const;
|
||||||
|
void clear();
|
||||||
TOutlook_window(int x, int y, int dx, int dy, WINDOW parent, TOutlook_field* owner);
|
TOutlook_window(int x, int y, int dx, int dy, WINDOW parent, TOutlook_field* owner);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1320,6 +1322,12 @@ bool TOutlook_window::select(int item, bool on)
|
|||||||
int TOutlook_window::selected() const
|
int TOutlook_window::selected() const
|
||||||
{ return xvt_list_get_sel_index(_ctrl); }
|
{ return xvt_list_get_sel_index(_ctrl); }
|
||||||
|
|
||||||
|
int TOutlook_window::items() const
|
||||||
|
{ return xvt_list_count(_ctrl); }
|
||||||
|
|
||||||
|
void TOutlook_window::clear()
|
||||||
|
{ xvt_list_clear(_ctrl); }
|
||||||
|
|
||||||
TOutlook_window::TOutlook_window(int x, int y, int dx, int dy, WINDOW parent, TOutlook_field* owner)
|
TOutlook_window::TOutlook_window(int x, int y, int dx, int dy, WINDOW parent, TOutlook_field* owner)
|
||||||
: TControl_host_window(x, y, dx, dy, parent, owner)
|
: TControl_host_window(x, y, dx, dy, parent, owner)
|
||||||
{
|
{
|
||||||
@ -1351,6 +1359,18 @@ TField_window* TOutlook_field::create_window(int x, int y, int dx, int dy, WINDO
|
|||||||
void TOutlook_field::create(short dlg, int x, int y, int dx, int dy, WINDOW parent)
|
void TOutlook_field::create(short dlg, int x, int y, int dx, int dy, WINDOW parent)
|
||||||
{ construct(dlg, "", x, y, dy, parent, "", dx); }
|
{ construct(dlg, "", x, y, dy, parent, "", dx); }
|
||||||
|
|
||||||
|
void TOutlook_field::clear()
|
||||||
|
{
|
||||||
|
TOutlook_window& ow = (TOutlook_window&)win();
|
||||||
|
ow.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
int TOutlook_field::items() const
|
||||||
|
{
|
||||||
|
TOutlook_window& ow = (TOutlook_window&)win();
|
||||||
|
return ow.items();
|
||||||
|
}
|
||||||
|
|
||||||
int TOutlook_field::add_item(short icon, const char* text, int flags)
|
int TOutlook_field::add_item(short icon, const char* text, int flags)
|
||||||
{
|
{
|
||||||
TOutlook_window& ow = (TOutlook_window&)win();
|
TOutlook_window& ow = (TOutlook_window&)win();
|
||||||
|
@ -83,7 +83,9 @@ protected: // TWindowed_field
|
|||||||
public:
|
public:
|
||||||
int add_item(short icon, const char* text, int flags);
|
int add_item(short icon, const char* text, int flags);
|
||||||
void create(short dlg, int x, int y, int dx, int dy, WINDOW parent);
|
void create(short dlg, int x, int y, int dx, int dy, WINDOW parent);
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
int items() const;
|
||||||
virtual void set(const char* data);
|
virtual void set(const char* data);
|
||||||
virtual const TString& get() const;
|
virtual const TString& get() const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user