Patch level : 2.2
Files correlati : Ricompilazione Demo : [ ] Commento : Aggiunta selezione report per classe invece che per libreria git-svn-id: svn://10.65.10.50/trunk@13233 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4276d68742
commit
c52d20a09a
@ -641,7 +641,7 @@ static bool get_xml_child(const TString& line, const char* tag, TString& value)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool list_custom_files(const char* ext, const char* library, TString_array& files)
|
||||
bool list_custom_files(const char* ext, const char* classe, TString_array& files)
|
||||
{
|
||||
TString_array lista;
|
||||
TFilename path;
|
||||
@ -664,7 +664,7 @@ bool list_custom_files(const char* ext, const char* library, TString_array& file
|
||||
list_files(path, lista);
|
||||
sort_files(lista); // Ordino i files e rimuovo i doppioni
|
||||
|
||||
TToken_string libraries(50, ',');
|
||||
TString8 acqua;
|
||||
TString stringona, desc;
|
||||
|
||||
FOR_EACH_ARRAY_ROW(lista, i, row)
|
||||
@ -678,17 +678,17 @@ bool list_custom_files(const char* ext, const char* library, TString_array& file
|
||||
for (int i = 0; i < 3 && scan.good(); i++) // Leggo solo le prime righe
|
||||
stringona << scan.line();
|
||||
|
||||
get_xml_attr(stringona, "libraries", libraries);
|
||||
if (library && *library)
|
||||
ok = libraries.get_pos(library) >= 0;
|
||||
get_xml_attr(stringona, "class", acqua);
|
||||
if (classe && *classe)
|
||||
ok = acqua == classe;
|
||||
|
||||
if (ok)
|
||||
{
|
||||
get_xml_child(stringona, "description", desc);
|
||||
TToken_string* riga = new TToken_string;
|
||||
riga->add(*row);
|
||||
riga->add(acqua);
|
||||
riga->add(desc);
|
||||
riga->add(libraries);
|
||||
files.add(riga);
|
||||
}
|
||||
}
|
||||
@ -699,7 +699,7 @@ bool list_custom_files(const char* ext, const char* library, TString_array& file
|
||||
|
||||
bool select_custom_file(TFilename& path, const char* ext, const char* library)
|
||||
{
|
||||
TArray_sheet sheet(-1, -1, 78, 20, TR("Selezione"), HR("Nome@20|Descrizione@50|Librerie@20"));
|
||||
TArray_sheet sheet(-1, -1, 78, 20, TR("Selezione"), HR("Nome@8|Classe@8|Descrizione@50"));
|
||||
TString_array& files = sheet.rows_array();
|
||||
|
||||
bool ok = list_custom_files(ext, library, files);
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include <colors.h>
|
||||
#include <expr.h>
|
||||
#include <image.h>
|
||||
#include <printer.h>
|
||||
#include <recarray.h>
|
||||
#include <relation.h>
|
||||
#include <reprint.h>
|
||||
#include <xml.h>
|
||||
|
||||
#include <anagr.h>
|
||||
#include <comuni.h>
|
||||
#include <nditte.h>
|
||||
@ -2078,6 +2078,9 @@ bool TReport::load(const char* fname)
|
||||
if (desc != NULL)
|
||||
desc->GetEnclosedText(_description);
|
||||
|
||||
_class = xml.GetAttr("class");
|
||||
_command_line = xml.GetAttr("command");
|
||||
|
||||
// Carico la query principale PRIMA delle sezioni che potrebbero collegarvicisi
|
||||
const TXmlItem* sql = xml.FindFirstChild("sql");
|
||||
if (sql != NULL)
|
||||
@ -2126,6 +2129,8 @@ bool TReport::save(const char* fname) const
|
||||
TXmlItem xml;
|
||||
xml.SetTag("report");
|
||||
xml.SetAttr("name", name);
|
||||
xml.SetAttr("class", _class);
|
||||
xml.SetAttr("command", _command_line);
|
||||
xml.SetAttr("lpi", _lpi);
|
||||
if (!_description.blank())
|
||||
xml.AddChild("description") << _description;
|
||||
|
@ -440,7 +440,9 @@ class TReport : public TAlex_virtual_machine
|
||||
TString _description;
|
||||
TReport_font _font, _print_font; // Font
|
||||
int _lpi; // Lines per inch
|
||||
TToken_string _include;
|
||||
TToken_string _include; // ex: calib
|
||||
TString8 _class; // ex: ca3300a
|
||||
TString _command_line; // ex: ca3 -2
|
||||
TReport_script _prescript, _postscript;
|
||||
TString_array _params;
|
||||
TRecordset* _recordset;
|
||||
@ -492,6 +494,10 @@ public:
|
||||
bool use_printer_font() const { return _use_printer_font; }
|
||||
void set_orientation(int orion) { _orientation = orion; }
|
||||
int orientation() const { return _orientation; }
|
||||
const TString& get_class() const { return _class; }
|
||||
void set_class(const char* classe) { _class = classe; }
|
||||
const TString& command_line() const { return _command_line; }
|
||||
void set_command_line(const char* cmd) { _command_line = cmd; }
|
||||
|
||||
void set_font(const TReport_font& f) { _font = f; }
|
||||
void unmap_font();
|
||||
|
@ -243,7 +243,7 @@ public:
|
||||
|
||||
PNT TPrint_preview_window::log2dev(long lx, long ly) const
|
||||
{
|
||||
PNT pnt = { lx, ly };
|
||||
PNT pnt = { short(lx), short(ly) };
|
||||
|
||||
const TPoint res = _book->page_res();
|
||||
if (res.x > 0 && res.y > 0) // Should always be true :-)
|
||||
|
Loading…
x
Reference in New Issue
Block a user