Change values of date pickers from drop down

  • Hi,

    Not sure if this is possible, but if you already have 2 date parameters (a start date and an end date for a report) and make another drop down parameter with specified values like 'Yesterday', 'Past Week', etc., is there a way where based on what is chosen in the drop down, it dynamically fills in the dates' pickers?

    Thanks.

  • Also realized I accidentally went to the wrong forum, meant to post in development.

  • Hi

    Assuming your parameters are derived from queries you can use cascading parameters.

    Create your first Param for Yesterday, last week ect and pass the results from this SQL into your start date and end date parameters

    Alternatively if your users do't need to see or modify the date range delete your start date and end date params and use the above parameter in its place..

    Andy

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • Andy,

    Thanks a lot. That makes sense. What about keeping the date parameter fields available for manually entering the dates as well? Basically having the option to put a predefined range from the drop down or manually entering. Is this possible?

    Thanks again,

    Dennis

  • Yep thats possible

    Use the above and pass your first parameter (yesterday, last week ect) into your @StartDate and @EndDate param's (the ones you will use in your dataset)

    Users will be able to see the dates and manually enter if they wish

    Andy

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • Andy,

    Thanks again. I think I'm getting somewhere. I have it working off two datasets, from 2 queries that take the date range picker variable, one for the start date and one for the end date. When picking Today, the dates go to today. Yesterday, to yesterday etc. So it's dynamically updating the date params.

    The issue I have now is that now the boxes for the start date and end date are not user modifiable. I attached a few examples. Is there some way to make the field in the parameter area be updateable from the range picker, but also be editable?

    Thank you for taking the time to help,

    Dennis

  • Ahh sorry I forgot that SSRS parameter would not allow the edit.

    There is one option I can think off but I don't think your going to like it (maybe someone else will have a more elegant solution)

    In your first parameter set up another option for custom date range and also set up another start and end date parameter in addition to the existing one.

    Then in your main dataset set up an IF ELSE block

    IF @DateRangePicker = 'Custom'

    <your dataset>

    WHERE

    Somedate BETWEEN @StartDateNew AND @EndDateNew

    ELSE IF @DateRangePicker <> 'Custom'

    <your dataset>

    WHERE

    Somedate BETWEEN @StartDateCascaded AND @EndDateCascaded

    Then hide the unused parameters as required

    Will that work for you?

    Andy

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • Andy,

    I'll try it out today. Sincerely, thank you very much!

    Dennis

  • Andy,

    Thinking through this, I can see it working. But I thought of another question. As I understand, you can't dynamically enable/disable/hide/unhide params in the param block, correct? If this is possible this seems like it would work without having all 4 date params visible. But I think I see what you're saying. I would have the uneditable dates hidden. I was just thinking since only the editable ones were seen, being able to enable or disable them based on if custom was selected or not.

    I wish they had more interaction programmability for parameters....

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply