问题
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