0
votes

I have a report with 2 parameters, @startdate and @enddate, which are date/time format. When the report runs, you choose the date from a calendar. I deploy the report to report server running SQL Server 2012 Report Server.

I've now set default values for the two parameters, as I want to set the range to be the beginning of this year to today. I set the default values as follows in the parameter properties in Visual Studio, using "specify values":

@startdate is set as 01/02/2013 00:00:00
@enddate is set as an expression =today()

When I preview the report locally in Visual Studio, it correctly fills the two parameters as I would expect. I deploy to the report server, and go in to Report Manager to create a subscription, but it doesn't have a "use default" next to the startdate parameter box. I also notice that the enddate parameter box has "use default" selected, but this and the input box are greyed out.

At first I thought it was an issue with the subscription set up, but when I run the deployed report from the report manager (and from a sharepoint page), it doesn't use my default value for the start date, and it is not until I choose a start date manually that it sets the enddate to today's date.

I can use an expression to return a specific date as a workaround, but my question here is why does the deployed report not recognise this default parameter when the locally run report does recognise it?

1
Not an answer as it is a workaround, but you can use an expression to return the specific date, which the report server and subscription setup then recognises as a default: =DateValue("February 01 2013")laurencemadill

1 Answers

1
votes

Just check a couple of things, as this should work, I do it all the time.

Make sure the report parameter is of type Date/Time and that it has a default value. This should already be the case as you can run it from VS and the defaults are visible.

Next navigate to the report server through the browser, find the report's rdl file, right click (or down arrow) -> Manage. Select the Parameters tab and make sure the HAS DEFAULT boxes are ticked, then click accept. When you upload the report for the first time it saves the parameters, if you then change the parameters in VS and upload again it doesnt seem to override the initial parameters. I always double check datasource and parameters after an upload.

Next go to the subscription tab, edit the subscription, at the bottom you'll see Report Parameter Values, the start date and end date parameter textboxes should be greyed out and next to it the box USE DEFAULT should be ticked.

Hope this helps you in finding the problem.