Solved

Date Selector in SSRS Report

Posted on 2012-04-04
3
1,186 Views
Last Modified: 2012-04-23
Hi,
I have built a report with 2 date parameters, @From and @To. They are of data type date/time, so the user can select start and end dates from a calendar box, which works great.
(@From and @To are in my SQL code)


I would like to have, alongside this, a drop down list with  Current Month, Previous Month, and maybe some other common selections.

How can I go about this?  I want to set the value of @To and @From based on what is chosen in the drop down, if possible. That way I wont have to do anything with my SQL code.
I tried to make a text variable called 'Quick Select', with available values of "current month", "Previous month",  etc, but it is greyed out until the calendar boxes are filled in, which defeats the purpose of it.

The screenshot shows an example of what I am after, this one was made in Crystal though.
dates.jpg
0
Comment
Question by:joemccnz
3 Comments
 
LVL 2

Expert Comment

by:davidi1
ID: 37810435
its dependancy issue.., first create the "Quick Select" using query & based on the selection, populate your From & To Date.
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 37813728
I see a couple of possible scenarios to get this working but none of them will be considered to be "easy".  But I'll give it a go...

Do you really want to have both the From and To in combination with the dropdown on your report?  Because that's already one step into making it complicated.  You'll need to look into cascading parameters to get that working, and cascading parameters are nice... as long as you don't want them to refresh every time the initial selection is changed.
See here for more info on what I mean: http://www.bp-msbi.com/2011/04/ssrs-cascading-parameters-refresh-solved/

For as much as it's possible, I'd try to handle the date logic in a stored procedure.  Try thinking about what you need (I'm not saying that you haven't already), and come up with a different scenario that's easier to implement.  Perhaps you can have two parameters: one of type datetime where the user selects a date and another with a dropdown containing items like "Full Month", "Previous Month", "Previous Week"...  Then pass both of those parameters into a stored procedure and handle them whichever way you see fit.

In case you're new on using SPs in combination with SSRS, a couple of articles:
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/A_1931-Reporting-On-Data-From-Stored-Procedures-part-1.html
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/A_2002-Reporting-On-Data-From-Stored-Procedures-part-2.html

Any further questions, just shout and we're here to help you!
0
 

Author Comment

by:joemccnz
ID: 37883054
Cheers ValentinoV, Ive decided to simplify it and do away with the To and From.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Hi All, I am here to write a simple article to move SSRS (SQL Server Reporting Services) reports from one server to another. When I have faced the same issue to move reports those were developed by developer on development server and now need to …
Hi, I have heard from my friends that it’s not possible to create Label Printing report using SSRS. I am amazed after hearing this words not possible in SSRS. I googled lot and found that it is possible to some of people know about the Report Bui…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

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