Search code examples
c#asp.netreportviewerrdlcrdl

Report if one value is null don't show other value


I'm trying to build a report with asp.net report.

If you check this image:

enter image description here

I'm showing a table with tickets and charge. The charge column has these value:

=Fields!Charge.Value

What I want to achieve is only to show the charge value if the ticket value is not null. So as you see in the image, there are 4 tickets visible and I want to show the charge only for those four tickets not all the charges.

Any idea how we can achieve that?


Solution

  • You can use something like the following in the charge column

     =IIF(IsNothing(Fields!Ticket.Value), "", Fields!Charge.Value)
    

    It should have worked otherwise you can try Fields!Ticket.Value == "" or Fields!Ticket.Value.ToString() == ""