Skip to content
guanlisheng edited this page Nov 3, 2014 · 6 revisions

General Report Framework is a quick tool to build customized report with

  • SQL
  • Lua
  • Template Engine
  • JavaScrips Lib (for intance Chart.js)

CONTENTS

  • This will store the SQL result
  • Use TMPL_LOOP to retrieve each row and TMPL_VAR for each column <TMPL_LOOP NAME=CONTENTS>

built-in tags

Default currency

void to_template(html_template& t)const
{
    t(L"CURRENCYID") = CURRENCYID;
    t(L"CURRENCYNAME") = CURRENCYNAME;
    t(L"PFX_SYMBOL") = PFX_SYMBOL;
    t(L"SFX_SYMBOL") = SFX_SYMBOL;
    t(L"DECIMAL_POINT") = DECIMAL_POINT;
    t(L"GROUP_SEPARATOR") = GROUP_SEPARATOR;
    t(L"UNIT_NAME") = UNIT_NAME;
    t(L"CENT_NAME") = CENT_NAME;
    t(L"SCALE") = SCALE;
    t(L"BASECONVRATE") = BASECONVRATE;
    t(L"CURRENCY_SYMBOL") = CURRENCY_SYMBOL;
}

Information

for (const auto &r: Model_Infotable::instance().all())
    (*this)(r.INFONAME.ToStdWstring()) = r.INFOVALUE;

Misc

(*this)(L"TODAY") = wxDateTime::Today().FormatDate();
void to_template(html_template& t) const
{   
    t(L"REPORTID") = REPORTID;
    t(L"REPORTNAME") = REPORTNAME;
    t(L"GROUPNAME") = GROUPNAME;
    t(L"SQLCONTENT") = SQLCONTENT;
    t(L"LUACONTENT") = LUACONTENT;
    t(L"TEMPLATECONTENT") = TEMPLATECONTENT;
    t(L"DESCRIPTION") = DESCRIPTION;
}

slider test

Clone this wiki locally