Solved

custom code in ssrs

Posted on 2008-06-24
1
1,420 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

840 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