Ну да...в источнике отчета лежит временная таблица, которую я пытаюсь заполнять (и она вроде как заполняется , так как в дебагере я вижу сменяющиеся RecId'ы этой таблицы). если в коде ошибок нет, то у меня руки опускаются ((
Вот заполнение временной таблицы как советовал
macklakov (уже в классе):
X++:
TmpMyTable generateTmpTable()
{
Query q;
QueryRun qr;
RAssetTable _table;
RAssetLending _lending;
TmpMyTable tmpTable;
;
q = this.initQuery();
qr = new QueryRun(q);
while (qr.next())
{
_table = qr.get(tablename2id("RAssetTable"));
_lending = qr.get(tablename2id("RAssetLending"));
tmpTable.AssetGroup = _table.AssetGroup;
tmpTable.AssetId = _lending.assetId;
tmpTable.AssetLendDate = _lending.AssetLendDate;
tmpTable.AssetLocation = _lending.AssetLocationId;
tmpTable.ContractACcount = _lending.ContractACcount;
tmpTable.LendEmployee = _lending.AssetLendEmployee;
tmpTable.insert();
}
Return tmpTable;
}
а вот сам запрос формируемый в классе
X++:
protected Query initQuery()
{
Query query;
QueryBuildDataSource qAssetLending;
QueryBuildDataSource qAssetTable;
;
query = new Query();
//
qAssetLending=query.addDataSource(TableNum(RAssetLending), "RAssetLending");
qAssetLending.addSelectionField(FieldNum(RAssetLending, AssetLendEmployee));
qAssetLending.addSelectionField(FieldNum(RAssetLending, ContractCode));
qAssetLending.addSelectionField(FieldNum(RAssetLending, ContractACcount));
qAssetLending.addSelectionField(FieldNum(RAssetLending, AssetId));
qAssetLending.addSelectionField(FieldNum(RAssetLending, AssetLendDate));
qAssetLending.addSelectionField(FieldNum(RAssetLending, AssetLocationId));
qAssetLending.addSelectionField(FieldNum(RAssetLending, PropertyPart));
qAssetLending.addSortField(FieldNum(RAssetLending, AssetLendEmployee));
qAssetTable=qAssetLending.addDataSource(TableNum(RAssetTable), "RAssetTable");
qAssetTable.addSelectionField(FieldNum(RAssetTable, Name));
qAssetTable.addSelectionField(FieldNum(RAssetTable, AssetGroup));
qAssetTable.joinMode(JoinMode::InnerJoin);
qAssetTable.fetchMode(0);
qAssetTable.addLink(FieldNum(RAssetLending, AssetId), FieldNum(RAssetTable, AccountNum));
return query;
}