I’m building a simple report layout, header/detail style. In the Servoy code I’m creating a report context object with a Dataset in it, like this:
// -- Create a report context object.
var reportContext = new Object();
// -- Get customer account header.
var sql = 'select address1,address2,address3,address4,addresspc,accountname from customer'
sql += ' where accountcode=?';
var headerDataset = databaseManager.getDataSetByQuery('operastatement', sql, [globals.LoginOperaAccount], 1);
headerDataset.rowIndex = 1;
application.output(headerDataset.getMaxRowIndex().toString());
//application.output('acc :' + headerDataset.address1);
reportContext.logo = StatementGetLogo();
reportContext.accountHeader = headerDataset;
plugins.VelocityReport.previewReport('statement.html', reportContext);
The dataset is getting data, for example headerDataset.address1 returns the correct string when examined in Debug view, as does reportContext.accountHeader.address1.
On my XHTML report I just have:
$accountHeader.address1
Which looking at the examples should output the correct address line 1 - however it just repeats the text ‘$accountHeader.address1’ when previewed.
Can’t figure out why …