Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Date Paramters Validation

Author  Topic 

srujanavinnakota
Starting Member

34 Posts

Posted - 2012-12-11 : 18:39:36
I am newbie to SSRS.
I have report with start date and end date parameters.
Report uses stored procedure to get the data. Can I validate the date parameters with executing Stored proc.

Thanks in Advance.

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-12-11 : 19:18:30
Do you mean whether you can validate the ranges of the dates within the stored procedure that is being called? You can - for example:
IF (@startDate < '20120101' OR @startDate > GETDATE())
BEGIN
RETURN;
END
That is just an example - you can make it as sophisticated as you wish to.
Go to Top of Page

srujanavinnakota
Starting Member

34 Posts

Posted - 2012-12-11 : 19:32:34
I don't want to do it in Stored Procedure.
If the users enter start date as 01-01-2012, then end date should always be greater than 01-01-2012

I did the following.

Added a textbox to the report (page header), type the error message in the textbox.
Set the visibility of the textbox based on the expression:
=IIF(Parameters!FromDate.Value>Parameters!ToDate.Value,False,True)
Set the visibility of the tablix based on the expression:
=IIF(Parameters!FromDate.Value>Parameters!ToDate.Value,True,False)

But Still it seems that Data set seems to be executing.

Go to Top of Page
   

- Advertisement -