Displaying Msg instead of blank report

  • Hi,

    We have a report with parameter username. When we pass username it will update his email.

    We have to enter the parameter. We didn't specify the the values or default values for that parameter. User has enter manually.

    But when they enter the username that is not existing in the database it is showing empty. It is showing values when they enter the username that exists in the database.

    I need to display some message in that report, when they enter any user name that is not in the database instead of showing empty I need to display "User name is not valid username"

    How to do that?

  • ramana3327 (11/20/2014)


    Hi,

    We have a report with parameter username. When we pass username it will update his email.

    We have to enter the parameter. We didn't specify the the values or default values for that parameter. User has enter manually.

    But when they enter the username that is not existing in the database it is showing empty. It is showing values when they enter the username that exists in the database.

    I need to display some message in that report, when they enter any user name that is not in the database instead of showing empty I need to display "User name is not valid username"

    How to do that?

    Assuming you have a dataset called dsUsers along the lines of:

    SELECT Id, UserName

    FROM dbo.Users

    WHERE UserName = @UserParam

    Then put an expression in a textbox and do something like:

    =IIF(First(Fields!UserName.Value, "dsUsers") IS Nothing, "User name is not valid username", Fields!UserName.Value & " is valid.")

    HTH,

    Rob

  • Thanks Robert.

    I do have another question

    The report is using the stored procedure. If I execute the sp and choose one username that doesn't exist database it will display the msg that username is not valid. But when the sp is executing for report, if I choose one username that doesn't exist in that database, the report is not displaying any results or not throwing any error like sp.

    How to setup that error in report that same as in SP.

    Is this similar to textbox expresssion or different?

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

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