Patch level : 12.0 nopatch
Files correlati : Commento : Aggiunti Reportprogram 0> eport che non lanciano in autmatico la maschera con lo stesso nome.
This commit is contained in:
parent
3631a0c132
commit
7a4f105218
@ -197,7 +197,7 @@ void TReport_font::save(TXmlItem& item) const
|
|||||||
bool TReport_font::load(const TXmlItem& item)
|
bool TReport_font::load(const TXmlItem& item)
|
||||||
{
|
{
|
||||||
const TXmlItem* font = item.FindFirstChild("font");
|
const TXmlItem* font = item.FindFirstChild("font");
|
||||||
if (font != NULL)
|
if (font != nullptr)
|
||||||
{
|
{
|
||||||
const TString& name = font->GetAttr("face");
|
const TString& name = font->GetAttr("face");
|
||||||
const int size = font->GetIntAttr("size", 10);
|
const int size = font->GetIntAttr("size", 10);
|
||||||
@ -210,10 +210,10 @@ bool TReport_font::load(const TXmlItem& item)
|
|||||||
style |= XVT_FS_UNDERLINE;
|
style |= XVT_FS_UNDERLINE;
|
||||||
create(name, size, style);
|
create(name, size, style);
|
||||||
}
|
}
|
||||||
return font != NULL;
|
return font != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
TReport_font::TReport_font() : _win_mapped(NULL_WIN), _fontid(NULL)
|
TReport_font::TReport_font() : _win_mapped(NULL_WIN), _fontid(nullptr)
|
||||||
{
|
{
|
||||||
create(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, XVT_FS_NONE);
|
create(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, XVT_FS_NONE);
|
||||||
}
|
}
|
||||||
@ -600,6 +600,7 @@ bool TReport_section::execute_prescript(const TBook& book)
|
|||||||
for (int i = 0; ok && i < items(); i++)
|
for (int i = 0; ok && i < items(); i++)
|
||||||
{
|
{
|
||||||
TReport_field& f = field(i);
|
TReport_field& f = field(i);
|
||||||
|
|
||||||
ok = f.execute_prescript();
|
ok = f.execute_prescript();
|
||||||
if (ok && f.dynamic_height())
|
if (ok && f.dynamic_height())
|
||||||
f.compute_draw_rect(book); // Serve fondamentalmente per MESSAGE _DESCRIGA
|
f.compute_draw_rect(book); // Serve fondamentalmente per MESSAGE _DESCRIGA
|
||||||
@ -1074,8 +1075,10 @@ void TReport_script::save(TXmlItem& root, const char* tag) const
|
|||||||
bool TReport_script::load(const TXmlItem& root, const char* tag)
|
bool TReport_script::load(const TXmlItem& root, const char* tag)
|
||||||
{
|
{
|
||||||
destroy();
|
destroy();
|
||||||
|
|
||||||
TXmlItem* script = root.FindFirstChild(tag);
|
TXmlItem* script = root.FindFirstChild(tag);
|
||||||
if (script != NULL)
|
|
||||||
|
if (script != nullptr)
|
||||||
{
|
{
|
||||||
_desc = script->GetAttr("description");
|
_desc = script->GetAttr("description");
|
||||||
script->GetEnclosedText(_src);
|
script->GetEnclosedText(_src);
|
||||||
@ -1681,15 +1684,18 @@ void TReport_field::print(TBook& book) const
|
|||||||
default :
|
default :
|
||||||
{
|
{
|
||||||
const TString& str = formatted_text();
|
const TString& str = formatted_text();
|
||||||
|
|
||||||
if (str.full())
|
if (str.full())
|
||||||
{
|
{
|
||||||
const TReport_font& pf = print_font();
|
const TReport_font& pf = print_font();
|
||||||
|
|
||||||
book.set_font(pf);
|
book.set_font(pf);
|
||||||
book.set_text_align(horizontal_alignment(), vertical_alignment());
|
book.set_text_align(horizontal_alignment(), vertical_alignment());
|
||||||
book.set_text_color(text_color(), back_color());
|
book.set_text_color(text_color(), back_color());
|
||||||
TString8 sec_code; section().code(sec_code);
|
|
||||||
|
|
||||||
|
TString8 sec_code; section().code(sec_code);
|
||||||
bool multiline = dynamic_height();
|
bool multiline = dynamic_height();
|
||||||
|
|
||||||
if (!multiline && (pf.lpi() > 6 || get_rect().height() > 100))
|
if (!multiline && (pf.lpi() > 6 || get_rect().height() > 100))
|
||||||
{
|
{
|
||||||
const int font_height = 720 / pf.lpi();
|
const int font_height = 720 / pf.lpi();
|
||||||
@ -1700,6 +1706,7 @@ void TReport_field::print(TBook& book) const
|
|||||||
{
|
{
|
||||||
TString_array para;
|
TString_array para;
|
||||||
TReport_rct rect = get_draw_rect();
|
TReport_rct rect = get_draw_rect();
|
||||||
|
|
||||||
book.compute_text_frame(str, pf, rect, para);
|
book.compute_text_frame(str, pf, rect, para);
|
||||||
print_rect(_draw_rct, book); // Stampa eventuale cornice
|
print_rect(_draw_rct, book); // Stampa eventuale cornice
|
||||||
if (para.empty())
|
if (para.empty())
|
||||||
@ -2160,7 +2167,9 @@ int TReport::parse_field(const char* code, char& type, int& level, int& id) cons
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
level = atoi((const char*)code + 1);
|
level = atoi((const char*)code + 1);
|
||||||
|
|
||||||
TReport_section* sec = find_section(type, level);
|
TReport_section* sec = find_section(type, level);
|
||||||
|
|
||||||
if (sec == NULL)
|
if (sec == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
const char* pdot = strchr(code, '.');
|
const char* pdot = strchr(code, '.');
|
||||||
@ -2232,8 +2241,8 @@ bool TReport::evaluate(const char* expr, TVariant& var, TFieldtypes force_type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const TFieldtypes ft = force_type != _nullfld ? force_type : var.type();
|
const TFieldtypes ft = force_type != _nullfld ? force_type : var.type();
|
||||||
var = e.as_variant(ft);
|
|
||||||
|
|
||||||
|
var = e.as_variant(ft);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2241,7 +2250,7 @@ void TReport::destroy()
|
|||||||
{
|
{
|
||||||
_sections.destroy();
|
_sections.destroy();
|
||||||
_description.cut(0);
|
_description.cut(0);
|
||||||
set_recordset(NULL);
|
set_recordset(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TReport::load_sections(const TXmlItem& xml)
|
void TReport::load_sections(const TXmlItem& xml)
|
||||||
@ -2249,12 +2258,14 @@ void TReport::load_sections(const TXmlItem& xml)
|
|||||||
for (int i = 0; i < xml.GetChildren(); i++)
|
for (int i = 0; i < xml.GetChildren(); i++)
|
||||||
{
|
{
|
||||||
const TXmlItem& sec = *xml.GetChild(i);
|
const TXmlItem& sec = *xml.GetChild(i);
|
||||||
|
|
||||||
if (sec.GetTag() != "section")
|
if (sec.GetTag() != "section")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const char type = sec.GetAttr("type")[0];
|
const char type = sec.GetAttr("type")[0];
|
||||||
const int level = sec.GetIntAttr("level");
|
const int level = sec.GetIntAttr("level");
|
||||||
TReport_section& rs = section(type, level);
|
TReport_section& rs = section(type, level);
|
||||||
|
|
||||||
rs.load(sec);
|
rs.load(sec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -678,4 +678,12 @@ public:
|
|||||||
virtual ~TReport();
|
virtual ~TReport();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class TProgramReport : public TReport
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual bool use_mask() { return false; }
|
||||||
|
|
||||||
|
TProgramReport() {}
|
||||||
|
virtual ~TProgramReport() {}
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user