Please help me with condition RRS feed

  • Question

  • I'm using the following code to set the value of a textbox in ReportViewer. It shows the value "KREDITFAKTURA" if the amount value is < 0, otherwise it shows "FAKTURA".

    =IIf(FormatNumber(Sum(Fields!RowAmount.Value, "InvoicePrint_spInvoiceRowPrintGet"), 2) < 0,"KREDITFAKTURA "& First(Fields!InvoiceNo.Value, "InvoicePrint_spInvoiceHeadPrintGet"), "FAKTURA "& First(Fields!InvoiceNo.Value, "InvoicePrint_spInvoiceHeadPrintGet"))

    The problem is that I receive an "#ERROR" when Sum(Fields!RowAmount.Value, "InvoicePrint_spInvoiceRowPrintGet") doesn't contain any value (when the data source is empty). In that case I want to show "FAKTURA", instead of "#ERROR". Can someone please help me with this?

    Very grateful for help!

    // SE

    Monday, October 6, 2008 1:22 PM

All replies

  • Hi SE,

    You can try using an IsNothing check. Iif(IsNothing(Sum(fieldvalue)), -1, Sum(fieldvalue))
    Brad Syputa, Microsoft Reporting Services This posting is provided "AS IS" with no warranties.
    Monday, October 6, 2008 6:55 PM