#error when using an expression in the report

  • Hi All,

    I'm using the below query to create a report,

    select 123 Value, Null String

    union

    select null, 'Days'

    And adding the fields to a table consisting of two columns.

    I'm using the following expressions in the first and second columns respectively.

    =Iif(IsNothing(Fields!Value.Value), "",Fields!Value.Value.ToString+" Min") --First Column expression.

    =Iif(IsNothing(Fields!String.Value), "",(Fields!String.Value).ToString) -- Second column expression'

    Is there anything wrong in the expressions or any suggestions?

    Please help me ASAP.

    Thanks in Advance.

    Regards,

    Ramu

    Ramu
    No Dream Is Too Big....!

  • Hi Ramu

    I'm at home and don't have SSRS installed on this PC, so can't guarantee that my syntax will be right, but what I would aim to use is something like:

    First Column expression:

    =Iif(Fields!Value.Value is Nothing, "",CSTR(Fields!Value.Value)+" Min")

    Second column expression:

    All you are doing here is replacing NULL with "". Is there any reason to do so? Wouldn't a NULL and "" look identical on the report?

    I would just set the cell to =Fields!String.Value

    If you do need to remove any NULLs, I think this should work:

    =Iif(Fields!String.Value is Nothing, "",Fields!String.Value) --

    Hope this helps

    Alun

  • Thanks a lot hkphooey for your reply,

    It worked exactly the way what i wanted.

    But can u explain what is the difference between the functions ToString to CSTR and IsNothing to Is Nothing.

    Thanks once again..:)

    Regards,

    Ramu

    Ramu
    No Dream Is Too Big....!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply