SSRS Parameterization

  • All,

    Hopefully someone can re-create this issue or offer a workaround.

    In short, I am trying to have a report take the date, hour, minute, and AM/PM parameter input from end users for start and end dates, build that final set (i.e "2/5/2010 8:10 AM") then ultimately pass the start and end dates into the stored procedure after doing a validation on the report.

    the problem I'm having is that I can set the default value for the RP_Start_DateTime parameter to this:

    =FormatDateTime(Parameters!RP_Start_Date.Value, DateFormat.ShortDate) & " " & Parameters!RP_Start_Hour.Value.ToString() & ":" & Parameters!RP_Start_Minute.Value.ToString() & ":00 " & Parameters!RP_Start_AMPM.Value.ToString()

    That formats exactly as I want.

    The problem is if I go back and change RP_Start_Date from say 2/5/2010 to 2/2/2010, the RP_Start_DateTime parameter doesn't refresh. Because I have it set as a default value, I understand why it won't refresh because then it takes away from the default. However, I can't change the value, have the RP_Start_DateTime update so that I can pass the correctly formatted date into the stored procedure I'm calling.

    I also tried loading the parameter selections into a report variable, but you can't use variables as parameters for data sets.

    Any thoughts/suggestions would be appreciated.

    Thanks!

    Steve

  • Don't suppose you could send me the RDL so that I could have a quick play with it.

    I have done a load of stuff with default/refreshing parameters recently, just finding it a bit difficult to see it in my head.

    JQ

  • I guess that would have helped, huh? I have attached it.

    Thanks for taking a look!

  • I didn't take a look at your attachment, but I think, if I remember from a long time ago, what you want to do is put the default value in the valid values section as well.



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • Can you elaborate on the valid values section? I have the default values set to an expression of the previous parameters.

    In short, I have a date/time parameter, and I have a drop down of hours, minutes, and am or pm, and i want to have a hidden parameter of the combo of them and send that complete date to the stored procedure.

    I could easily take the values and validate them using report variables, and once past validation, pass in the individual values for hour, minute, and am/pm and concatenate them within the procedure, but it's just bugging me why I can't get the parameter values to refresh after one of the earlier selections are modified.

    ie "2/2/2010 8:15 AM" is the "default value" based on the selections made, and I want to change it to "2/1/2010 8:15AM", but the last parameter retains "2/2/2010 8:15 AM".

  • On your hidden parameter copy the expression from the default value section, and also put it in the available values section. (you need it in both places)

    In ssrs 2005, the the available values section is a grid in the middle, and in 2008 there is an item in the left list for available values right above the default values selection.

    Sory, I guess I used the wrong name the first time.



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • Wow, that was so disgustingly easy and was exactly what i was looking for...

    Thanks so much!

    Impossible to google for something like that, so I turned to my peers here, and once again they came through.

    Thanks again,

    Steve

Viewing 7 posts - 1 through 6 (of 6 total)

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