SQL Server Reporting Services DataTime Parameter
In Our Application we are using Datatime Parameter. In this Parameter, we will show upto current date. it will enable past date and disable future date. Is there any way to do this.
April 8th, 2011 8:26am

does that mean you want to show all the past dates including today and not future dates?
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2011 1:49pm

Hi SriSeshaa, Based on your description, I think that your requirement is: you can select the past date or current data to show a report, but the future date is not allowed. If I have misunderstood, please point out. The Datetime parameter always allows us to select the past date or the future date. Generally, we have a workaround to deal with this issue. We can add a textbox to show error message if we select the future date in the Datetime parameter, and the report contents will be hidden. For example, I have added a Matrix and a Datetime parameter in my report. When I select the past date or current date, the report contents will be showed; but when I select the future date, the report contents will be hidden, and the error message will be showed. Please refer to the steps to achieve it: 1. Select the Matrix. 2. In the Matrix Properties window, in the Hidden property, set the expression like this: =IIF(DateSerial(Year(Now()),Month(Now()),Day(Now())<Parameters!Datetime.Value,TRUE,FALSE) 3. Drag a Text Box to the design surface, double-click the Text Box and type some error message. 4. Select the Text Box, in the Text Box Properties window, in the Hidden property, set the expression like this: =IIF(DateSerial(Year(Now()),Month(Now()),Day(Now())<Parameters!Datetime.Value,FALSE,TRUE) If you have another Datetime parameter as To date, we can automatically setting the search criteria from future date to the current date. Please refer to the steps below: 1. In the Report Data window, right-click Todate parameter, and then select Parameter Properties. 2. Type in “YourParamterName” both “Name” and “Prompt”, in the Data type drop-down list, select Date/Time. 3. Click Default Values, select the option “Specify values”, and then click Add. 4. Click fx button and set the expression like this: =DateSerial(Year(Now()),Month(Now()),Day(Now()) Thanks, Bin Long
April 13th, 2011 3:33am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics