I have a question regarding on how to retrieve the records that I have selected in a form, to a report.
我有一个关于如何检索我在表单中选择的记录到报告的问题。
Currently, I am able to select multiple records, but when it comes to the report, it keep on processing the same value. However the number of the records that it processed is correct, only the value is repeating.
目前,我可以选择多个记录,但是当涉及到报告时,它会继续处理相同的值。但是,它处理的记录数是正确的,只有值重复。
I am not sure on how to fix this, therefore your help is kindly appreciated.
我不确定如何解决这个问题,所以我们非常感谢您的帮助。
Below is the part that i get the record:
以下是我获得记录的部分:
if (element.args() && element.args().dataset())
{
switch(args.dataset())
{
case tablenum(LedgerJournalTrans) :
ledgerJournalTrans = element.args().record();
info(ledgerJournalTrans.Voucher);
break;
case tablenum(LedgerJournalTable) :
ledgerJournalTable = args.record();
break;
}
}
1 个解决方案
#1
0
The element.args().record()
only points to the last selected record. Its datasource comes to rescue. The usual approach to process multi-selected records applies:
element.args()。record()仅指向最后选择的记录。它的数据源来救援。处理多选记录的常用方法适用:
Common record;
FormDataSource fds;
fds = element.args().record().dataSource();
for (record = fds.getFirst(1) ? fds.getFirst(1) : fds.cursor(); record; record = fds.getNext())
{
// Do the printing using record
}
You often see this approach used in main
methods of functions capable of processing multi-selected records.
您经常会看到这种方法在主要的函数方法中使用,能够处理多选记录。
The FormLetter.getFormRecord
uses this pattern as well.
FormLetter.getFormRecord也使用此模式。
#1
0
The element.args().record()
only points to the last selected record. Its datasource comes to rescue. The usual approach to process multi-selected records applies:
element.args()。record()仅指向最后选择的记录。它的数据源来救援。处理多选记录的常用方法适用:
Common record;
FormDataSource fds;
fds = element.args().record().dataSource();
for (record = fds.getFirst(1) ? fds.getFirst(1) : fds.cursor(); record; record = fds.getNext())
{
// Do the printing using record
}
You often see this approach used in main
methods of functions capable of processing multi-selected records.
您经常会看到这种方法在主要的函数方法中使用,能够处理多选记录。
The FormLetter.getFormRecord
uses this pattern as well.
FormLetter.getFormRecord也使用此模式。