How to set To Date is always greater than Start Date or can we gray out the To Date fields which are lesser than Start Date?

  • Conditional formating in the visibility property =>

    =IIF(Parameters!BeginDate.Value > Parameters!EndDate.Value, False, True)

  • No popup but you could have a NoRowsMessage expression that evaluates the start and end dates and warns the user that the reason why they didn't get any data is because they made a mistake in the date range.

  • Tablix have a property called NoRowsMessage. You can find it in the advanced properties of the tablix, or by pressing F4. The NoRowsMessage property can be populated with an expression. In your case it might be something like

    =IIF(Parameters!ToDate.Value < Parameters!FromDate.Value,"This report requires a FromDate parameter to be less than the ToDate parameter. Please try again with this in mind.","There is no data that meets the input parameters. Please try again with different parameters")

    When they put a ToDate that is less than the FromDate, the body of the report will display the first message. If the that is not the case, but the report does not return any data it will return the 2nd message.

  • Thanks much Daniel, I'll implement the same.

    Thanks !!

  • Thanks Daniel, that worked ? however in my case – StartDate, EndDate, Area and rest all parameters are cascaded to each other. So unless I select all the required parameters it’s not letting me to click on View Report.

    =IIF(Parameters!ToDate.Value<Parameters!BeginDate.Value,"This report requires a FromDate parameter to be less than the ToDate parameter. Please try again with this in mind.","There is no data that meets the input parameters. Please try again with different parameters")

    I have implemented the similar way as you suggested, but still I couldn’t achieve my goal.

    Please help!!!

  • Maybe set a default value on the 2nd date parameter so that it gets an appropriate date. =DateAdd("d",10,Parameters!StartDate.Value)

    [font="Courier New"]Looking for a Deadlock Victim Support Group..[/font]
  • The NoRowsMessage only works when the report is run. If you have cascading parameters, or any required parameters for that matter, you will have to supply values for all the parameters and run the report before you can see the message.

  • [font="Arial"][/font]

    Thanks all, I will implement the same and update you if I see any issues.

Viewing 8 posts - 16 through 22 (of 22 total)

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