Files correlati : ba3.exe Ricompilazione Demo : [ ] Commento : RiInserita la stampa tabelle con i report git-svn-id: svn://10.65.10.50/trunk@12899 c028cbd2-c16b-5b4b-a496-9718f37d4682
104 lines
2.2 KiB
C++
Executable File
104 lines
2.2 KiB
C++
Executable File
//Programma per stampa report tabelle
|
|
|
|
#include <applicat.h>
|
|
#include <automask.h>
|
|
#include <relation.h>
|
|
#include <reprint.h>
|
|
#include <tabutil.h>
|
|
#include "ba3200.h"
|
|
|
|
///////////////////////////////////////////////////////////
|
|
// TMask_print_table
|
|
///////////////////////////////////////////////////////////
|
|
|
|
class TMask_print_table : public TAutomask
|
|
{
|
|
|
|
protected:
|
|
bool on_field_event(TOperable_field& o, TField_event e, long jolly) {return true;}
|
|
public:
|
|
TMask_print_table(const char * name);
|
|
virtual ~TMask_print_table() {}
|
|
};
|
|
|
|
TMask_print_table::TMask_print_table(const char * name)
|
|
:TAutomask(name)
|
|
{
|
|
TEdit_field & f = add_string(F_REPORT, 0, "Report ", 2, -3, 20, "B");
|
|
f.set_query_button(new TReport_select(&f, name));
|
|
f.enable_check();
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////
|
|
// TTable_report
|
|
///////////////////////////////////////////////////////////
|
|
|
|
class TTable_report : public TReport
|
|
{
|
|
public:
|
|
virtual bool use_mask() { return false;}
|
|
|
|
TTable_report() {}
|
|
virtual ~TTable_report() {}
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////
|
|
// TTable_reporter
|
|
///////////////////////////////////////////////////////////
|
|
|
|
class TTable_reporter : public TSkeleton_application
|
|
{
|
|
protected:
|
|
virtual void main_loop();
|
|
|
|
public:
|
|
bool get_rpt_name(TFilename& rptname) const;
|
|
};
|
|
|
|
|
|
bool TTable_reporter::get_rpt_name(TFilename& rptname) const
|
|
{
|
|
TTable tab(argv(2));
|
|
rptname = tab.module();
|
|
rptname << "st" << tab.get("COD");
|
|
rptname.ext("rep");
|
|
rptname.lower();
|
|
|
|
return rptname.custom_path();
|
|
}
|
|
|
|
void TTable_reporter::main_loop()
|
|
{
|
|
TFilename rptname;
|
|
|
|
if (get_rpt_name(rptname))
|
|
{
|
|
|
|
TFilename msk(rptname.name()); msk.ext(""); msk.lower();
|
|
TMask_print_table m(msk);
|
|
|
|
while (m.run() == K_ENTER)
|
|
{
|
|
TTable_report rep;
|
|
TReport_book book;
|
|
TString name(m.get(F_REPORT));
|
|
|
|
if (name.empty())
|
|
name = rptname;
|
|
rep.load(name);
|
|
rep.mask2report(m);
|
|
book.add(rep);
|
|
book.print_or_preview();
|
|
}
|
|
}
|
|
else
|
|
error_box(FR("Manca il file %s"), (const char *)rptname);
|
|
}
|
|
|
|
|
|
int ba3200(int argc, char* argv[])
|
|
{
|
|
TTable_reporter app;
|
|
app.run(argc, argv, TR("Stampa Tabelle"));
|
|
return 0;
|
|
} |