Reporting Parameter Validation message

  • hi All,

    I have a report which has a parameter's called startdate and Endate of DateTime datatype. if user selects the StartDate > EndDate or EndDate<StartDate i need to show the Error Message. please can any body help me to solve this problem

    Thanks & regards

    DeepaK.A

  • Instead you might want to make the end date dependant on the start date (cascading parameters) so that the end date can not be less than the start date.

  • Hi Daniel thanks for your reply can you please tel me how to set the cascade option im using SSRS 2008

  • You do it by making your available parameter values come from dependant queries. For example the available values for your enddate would come from a query something like:

    SELECT datefield AS EndDate FROM TableWithDates WHERE datefield > @StartDate

    You must make sure your @StartDate parameter is populated before the query in this case is run. You do that by moving your parameters up or down in the parameter list.

  • I would make the parameters dependent as others have suggested.

    If you absolutely had to produce an error message, you could set a hidden boolean parameter (e.g. HIDE) and default that to True if the end_date < start date or start_date > end_date and then set the hidden property of all your report items = HIDE. Then, add a text box with your error message, and set the hidden property to !HIDE. So if the data params are wrong the error message will show and if they are ok, the results will show.

    The main drawback to that is that it won't prevent your queries from running, so you will have to handle invalid parameters in your query as well.

  • Daniel Bowlin (10/19/2010)


    You do it by making your available parameter values come from dependant queries. For example the available values for your enddate would come from a query something like:

    SELECT datefield AS EndDate FROM TableWithDates WHERE datefield > @StartDate

    You must make sure your @StartDate parameter is populated before the query in this case is run. You do that by moving your parameters up or down in the parameter list.

    hi Daneil,

    thanks for the reply once again , We are not taking the StartDate and EndDate from the query. users will select the Date from the calender, the requirement is to validate as soon as they select the invalid the date range between the StartDate and EndDate as popup

    Regards,

    Deepak.A

  • Jay_Noob (10/19/2010)


    I would make the parameters dependent as others have suggested.

    If you absolutely had to produce an error message, you could set a hidden boolean parameter (e.g. HIDE) and default that to True if the end_date < start date or start_date > end_date and then set the hidden property of all your report items = HIDE. Then, add a text box with your error message, and set the hidden property to !HIDE. So if the data params are wrong the error message will show and if they are ok, the results will show.

    The main drawback to that is that it won't prevent your queries from running, so you will have to handle invalid parameters in your query as well.

    hi Jay_Noob,

    Thanks For your reply currently we are diong the same method to show the error message.

    The requirement is to validate as soon as they select the invalid the date range between the StartDate and EndDate as popup

    is that achievable in SSRS 2005/2008

    Regards,

    Deepak.A

  • Hi there, I am new to ssrs 2008 r2, please can you explain in detail.

    Thanks in advance.

Viewing 8 posts - 1 through 7 (of 7 total)

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