Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1482
  • Last Modified:

custom code in ssrs

can anyone tell me if its possible to display a Message box or Alert in ssRS with custom code? Basically, i want to compare the value of two parameter and based on certain condition i want to display an Alert. e.g. There are two param of a reports; "Start Date" and "End Date". Is it possible to check the date before excuting the reports. I want to check that "Start date" must  be less than equal to "End Date". How can i do this ssrs?
0
mshan
Asked:
mshan
1 Solution
 
jgvCommented:
I don't believe it's possible to test parameter values before the report is executed (only after). I would think that if the user has entered a start date that is greater than the end date your query would not return any records. If this is the case then you could use this method to provide a message that a mistake was made with the date parameters.

Select your main report table. In the "NoRows" property add this as the expression:
=IIF(Parameters!StartDate.Value > Parameters!EndDate.Value, "The Start Date cannot be greater than the End Date", "No records found matching your criteria")
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now