Hiding/showing report field based on values

十年热恋 提交于 2019-12-13 03:58:58

问题


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:


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 : '';
}


来源:https://stackoverflow.com/questions/10381595/hiding-showing-report-field-based-on-values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!