Patch level : 2.1 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento : Correzionio editor di report e di query git-svn-id: svn://10.65.10.50/trunk@12148 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4e940e81c4
commit
c27b814001
@ -708,6 +708,17 @@ void TQuery_mask::sheet2sql()
|
|||||||
expr_to = row->get(6); expr_to.trim();
|
expr_to = row->get(6); expr_to.trim();
|
||||||
if (expr_from.not_empty() || expr_to.not_empty())
|
if (expr_from.not_empty() || expr_to.not_empty())
|
||||||
{
|
{
|
||||||
|
if (expr_from.not_empty() && expr_from[0] != '\'' && !isdigit(expr_from[0]))
|
||||||
|
{
|
||||||
|
expr_from.insert("'");
|
||||||
|
expr_from << '\'';
|
||||||
|
}
|
||||||
|
if (expr_to.not_empty() && expr_to[0] != '\'' && !isdigit(expr_to[0]))
|
||||||
|
{
|
||||||
|
expr_to.insert("'");
|
||||||
|
expr_to << '\'';
|
||||||
|
}
|
||||||
|
|
||||||
if (expr_from == expr_to)
|
if (expr_from == expr_to)
|
||||||
{
|
{
|
||||||
add_where_clause(where, field, "=", expr_from);
|
add_where_clause(where, field, "=", expr_from);
|
||||||
@ -751,9 +762,7 @@ void TQuery_mask::sheet2isam()
|
|||||||
|
|
||||||
TString use;
|
TString use;
|
||||||
FOR_EACH_ARRAY_ROW(rel, i, row)
|
FOR_EACH_ARRAY_ROW(rel, i, row)
|
||||||
{
|
|
||||||
use << *row << '\n';
|
use << *row << '\n';
|
||||||
}
|
|
||||||
|
|
||||||
set(F_SQL, use, true);
|
set(F_SQL, use, true);
|
||||||
_sql_dirty = false;
|
_sql_dirty = false;
|
||||||
|
@ -877,8 +877,8 @@ void TReport_mask::on_print()
|
|||||||
#else
|
#else
|
||||||
TReport_book book;
|
TReport_book book;
|
||||||
#endif
|
#endif
|
||||||
if (book.add(_report))
|
book.add(_report);
|
||||||
book.print_or_preview();
|
book.print_or_preview();
|
||||||
}
|
}
|
||||||
|
|
||||||
TReport_section& TReport_mask::curr_section()
|
TReport_section& TReport_mask::curr_section()
|
||||||
@ -898,19 +898,19 @@ void TReport_mask::select_section()
|
|||||||
const char type = _curr_section->type();
|
const char type = _curr_section->type();
|
||||||
const int level = _curr_section->level();
|
const int level = _curr_section->level();
|
||||||
|
|
||||||
char htype = 'H', ftype = 'F';
|
char htype = 'H';
|
||||||
int hlevel = level, flevel = level;
|
int hlevel = level;
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case 'H':
|
case 'H':
|
||||||
{
|
{
|
||||||
if (level <= 1)
|
if (level <= 1)
|
||||||
hlevel = flevel = 1-level;
|
hlevel = 1-level;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_report.find_section('H', level-1))
|
if (_report.find_section('H', level-1))
|
||||||
hlevel = flevel = level-1;
|
hlevel = level-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -918,22 +918,22 @@ void TReport_mask::select_section()
|
|||||||
{
|
{
|
||||||
if (level >= 1)
|
if (level >= 1)
|
||||||
{
|
{
|
||||||
hlevel = flevel = _report.find_max_level('H');
|
hlevel = _report.find_max_level('H');
|
||||||
if (hlevel <= 1)
|
if (hlevel <= 1)
|
||||||
hlevel = flevel = 0;
|
hlevel = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
hlevel = flevel = 0;
|
hlevel = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'F':
|
case 'F':
|
||||||
{
|
{
|
||||||
if (level <= 1)
|
if (level <= 1)
|
||||||
hlevel = flevel = 1-level;
|
hlevel = 1-level;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_report.find_section('F', level-1))
|
if (_report.find_section('F', level-1))
|
||||||
hlevel = flevel = level-1;
|
hlevel = level-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -943,9 +943,6 @@ void TReport_mask::select_section()
|
|||||||
TReport_drawer& rdh = (TReport_drawer&)field(F_REPORTH);
|
TReport_drawer& rdh = (TReport_drawer&)field(F_REPORTH);
|
||||||
rdh.set_report_section(_report.section(htype, hlevel));
|
rdh.set_report_section(_report.section(htype, hlevel));
|
||||||
|
|
||||||
TReport_drawer& rdf = (TReport_drawer&)field(F_REPORTF);
|
|
||||||
rdf.set_report_section(_report.section(ftype, flevel));
|
|
||||||
|
|
||||||
update_report();
|
update_report();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -959,9 +956,6 @@ void TReport_mask::update_report() const
|
|||||||
|
|
||||||
TReport_drawer& rd = (TReport_drawer&)field(F_REPORT);
|
TReport_drawer& rd = (TReport_drawer&)field(F_REPORT);
|
||||||
rd.win().force_update();
|
rd.win().force_update();
|
||||||
|
|
||||||
TReport_drawer& rdf = (TReport_drawer&)field(F_REPORTF);
|
|
||||||
rdf.win().force_update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TReport_mask::add_field()
|
void TReport_mask::add_field()
|
||||||
@ -1137,7 +1131,7 @@ void TReport_mask::report_properties()
|
|||||||
void TReport_mask::notify_focus_field(short id)
|
void TReport_mask::notify_focus_field(short id)
|
||||||
{
|
{
|
||||||
TAutomask::notify_focus_field(id);
|
TAutomask::notify_focus_field(id);
|
||||||
if (id == F_REPORTH || id == F_REPORTF)
|
if (id == F_REPORTH || id == F_REPORT)
|
||||||
{
|
{
|
||||||
TReport_drawer& rd = (TReport_drawer&)field(id);
|
TReport_drawer& rd = (TReport_drawer&)field(id);
|
||||||
_curr_section = &rd.curr_section();
|
_curr_section = &rd.curr_section();
|
||||||
@ -1282,8 +1276,8 @@ TReport_mask::TReport_mask() : _tree(_report), _is_dirty(false)
|
|||||||
TTree_field& albero = tfield(F_SECTIONS);
|
TTree_field& albero = tfield(F_SECTIONS);
|
||||||
RCT rct_sec; albero.get_rect(rct_sec);
|
RCT rct_sec; albero.get_rect(rct_sec);
|
||||||
|
|
||||||
const short sec[3] = { F_REPORT, F_REPORTH, F_REPORTF };
|
const short sec[2] = { F_REPORT, F_REPORTH };
|
||||||
for (int s = 0; s < 3; s++)
|
for (int s = 0; s < 2; s++)
|
||||||
{
|
{
|
||||||
TReport_drawer& rd = (TReport_drawer&)field(sec[s]);
|
TReport_drawer& rd = (TReport_drawer&)field(sec[s]);
|
||||||
RCT rct_rep; rd.get_rect(rct_rep);
|
RCT rct_rep; rd.get_rect(rct_rep);
|
||||||
@ -1295,7 +1289,6 @@ TReport_mask::TReport_mask() : _tree(_report), _is_dirty(false)
|
|||||||
switch (s)
|
switch (s)
|
||||||
{
|
{
|
||||||
case 1 : rd.set_report_section(_report.section('H', 0)); break;
|
case 1 : rd.set_report_section(_report.section('H', 0)); break;
|
||||||
case 2 : rd.set_report_section(_report.section('F', 0)); break;
|
|
||||||
default:
|
default:
|
||||||
_curr_section = &_report.section('B', 1);
|
_curr_section = &_report.section('B', 1);
|
||||||
rd.set_report_section(*_curr_section);
|
rd.set_report_section(*_curr_section);
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
#define F_REPORTH 105
|
#define F_REPORTH 105
|
||||||
#define F_REPORT_TITLE 106
|
#define F_REPORT_TITLE 106
|
||||||
#define F_REPORT 107
|
#define F_REPORT 107
|
||||||
#define F_REPORTF_TITLE 108
|
|
||||||
#define F_REPORTF 109
|
|
||||||
#define F_FLD_ADD 110
|
#define F_FLD_ADD 110
|
||||||
#define F_FLD_PROPERTIES 111
|
#define F_FLD_PROPERTIES 111
|
||||||
#define F_SEC_ADD 112
|
#define F_SEC_ADD 112
|
||||||
|
@ -66,29 +66,19 @@ BEGIN
|
|||||||
PROMPT 41 1 "Testata di livello 0"
|
PROMPT 41 1 "Testata di livello 0"
|
||||||
END
|
END
|
||||||
|
|
||||||
REPORT F_REPORTH -3 3
|
REPORT F_REPORTH -3 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 21 2 ""
|
PROMPT 21 2 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
TEXT F_REPORT_TITLE
|
TEXT F_REPORT_TITLE
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 41 5 "Corpo di livello 0"
|
PROMPT 41 6 "Corpo di livello 0"
|
||||||
END
|
END
|
||||||
|
|
||||||
REPORT F_REPORT -3 9
|
REPORT F_REPORT -3 -3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 21 6 ""
|
PROMPT 21 7 ""
|
||||||
END
|
|
||||||
|
|
||||||
TEXT F_REPORTF_TITLE
|
|
||||||
BEGIN
|
|
||||||
PROMPT 41 -7 "Coda di livello 0"
|
|
||||||
END
|
|
||||||
|
|
||||||
REPORT F_REPORTF -3 -3
|
|
||||||
BEGIN
|
|
||||||
PROMPT 21 -6 ""
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user