Expressions to show beginning and end dates reflected in report

  • SSRS 2008 R2

    Have set up cascading params whereby user can select from available year(s), month(s) and days.

    What expressions do I use in header that will show beginning and end dates reflected in the report, based on YMD user selections? (e.g., "This report reflects available data from April 12, 2011 through December 1, 2012")

  • This should get you close. Your parameter names will probably be different.

    ="This report reflects available data from " & Parameters!StartMonthName.Value & " " & Parameters!StartDay.Value & ", " & Parameters!StartYear.Value & " " through " & Parameters!EndMonthName.Value & " " & & Parameters!EndDay.Value & ", " & Parameters!EndYear.Value

  • Makes sense, but I'm still confused. Parameters are ParamYear, ParamMonth, etc., but not clear on where the "start" and "end" components come from.

    From the Year dropdown, user might select 2012, then select Jan, Feb and Mar from Month dropdown, then all days from Days dropdown.

    Top of that report would show "This report reflects available data from Jan 1, 2012 through March 30, 2012. So SSRS would be getting the start/end dates not from the dropdown selections, but rather from what is generated in the report. Or would it??

    Is a better solution is to have two sets of dropdown selections - first YMD of data, last YMD of data? But then not sure how to structure cascading parameters to prevent setting end date before start date. However, that would make sense if they needed to select a partial month (i.e., Jan 1 thru Mar 15).

    My first pass on this was to merely list years, months, days included in report. But that was misleading, as it didn't account for partial start or end months.

    Really appreciate you helping me think this through...

  • I assumed you were using start and stop dates for your report. In other words 2 sets of parameters. If you are just using one set of parameters, is that for the start date of the report? Where does the end date come from? Is it calculated from the start by adding 90 days, or 3 months or something? If so then you have a little more work to do to calculate the expression for the ending dates. I am curious why you are using individual Y, M, D elements rather than using the date picker, that would definitely make this easier.

Viewing 4 posts - 1 through 3 (of 3 total)

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