Класс для работы с шаблонами в HTML формате. Наследует iTemplate.
Приведенный пример показывает создание таблицы размеров 10х10.
function printreport()
{
p = new Report("Report1");
p.setTable("report.tpl");
p.setValue("title","Заголовок таблицы :"+Value("eHeader") + Value("fNDS"));
p.exec("main");
for ( i = 1; i<10; i++)
{
p.setValue("value", String(i) );
p.exec("trow");
for ( j=1; j<10; j++)
{
p.setValue("value", String(i)+":"+String(j) );
p.exec("col");
}
p.exec("endrow");
}
p.exec("endmain");
p.show();
delete p;
}
Шаблон:
<#section main#>
<html>
<header>
<title>Ananas HTTP Server</title>
</header>
<body bgcolor=gray>
<img src="a-system.png"><#title#>
<table border=1 cellspacing=0 cellpadding=0 spacing=0>
<#endsection#>
<#section endmain#>
</table>
</body></html>
<#endsection#>
<#section trow#><tr><td width=100 bgcolor=lightblue><#value#>)</td><#endsection#>
<#section endrow#></tr>
<#endsection#>
<#section col#><td align=center><#value#></td><#endsection#>