Solved

custom code in ssrs

Posted on 2008-06-24
1
1,414 Views
Last Modified: 2008-07-08
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
Comment
Question by:mshan
1 Comment
 
LVL 12

Accepted Solution

by:
jgv earned 500 total points
ID: 21861851
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question