SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Date Paramters Validation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

srujanavinnakota
Starting Member

34 Posts

Posted - 12/11/2012 :  18:39:36  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/11/2012 :  19:18:30  Show Profile  Reply with Quote
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 - 12/11/2012 :  19:32:34  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000