Hiding/showing report field based on values

2019-08-24 02:35发布

this is a really simple query but I have a total mental block with it.

I am modifying the Customer Account Statement report, and we have two Invoice ID Fields, I want to hide one if there is a value in the other. For example;

If(custTrans.InvoiceID_1 != '')
{
    return CustTrans.InvoiceID_1
}

else return InvoiceID_2;

I understand this would be carried out in Fetch Method, but I believe this is not the case, I have tried several ways of carrying out this change but have had no luck, any assistance would be appreciated.

1条回答
beautiful°
2楼-- · 2019-08-24 03:30

Well, one way is to use the visible attribute of the report field.

This will not work nice in a list though, here you would be better off with two display methods:

display InvoiceId invoiceId_1()
{
     return this.InvoiceId_1 ? this.InvoiceId_1 : this.InvoiceId_2;
}    
display InvoiceId invoiceId_2()
{
     return this.InvoiceId_1 ? this.InvoiceId_2 : '';
}
查看更多
登录 后发表回答