如何使用x ++引用报表数据源表

时间:2009-11-25 23:41:39

标签: axapta

我无法找到引用SalesInvoice报表数据源的CustInvoiceTrans表的正确语法。

以下是上下文:我在InventItemGroup表上创建了一个新的分类字段,需要从发票上的每个项目中获取此字段的数据,然后在发票的标题上汇总这些数据。

1 个答案:

答案 0 :(得分:0)

查看SalesInvoice报告的方法fetch()。

while (tradeLoopTrans.next())

{

   custInvoiceTrans = tradeLoopTrans.get(tablenum(CustInvoiceTrans));

   // ....

   this.send(custInvoiceTrans);

custInvoiceTrans是将在报告中打印的每条发票行。

接下来看看Design,Section Group:CustInvoiceJour - > Section Group:CustInvoiceTrans。以下是将要打印的所有字段

所以你需要:

  • 在表CustInvoiceTrans上创建显示方法:

    display str getClassification()
    {
       InventTable      table = InventTable::find(this.ItemId);
       InventItemGroup  grp = InventItemGroup::find(teble.ItemGroupId);
       ;
       return grp.new_field
    }
    

    此方法返回每个CustInvoiceTrans的分类。

  • 在报表设计上,在章节组:CustInvoiceTrans中创建一个新字段  DataSource = CustInvoiceTrans  DataMethod = getClassification