Auto populate dates of the week Paginated reports - reporting-services

Good day
I am very very new two paginated reports so forgive me if this is a silly question
I have a report that displays values for Mondays to Fridays based on the date selected from a date picker.
So basically
You select a date (Example 24 Nov) and the following table is displayed based on values pulled from SQL.
Now my question is how do I display the dates of the weekdays too?
So if the date selected is Thursday 24 Nov, in the column headers under the week day names it should give the corresponding date i.e Monday-21/11/2022, Tuesday - 22/11/2022, etc.
Below is a little snippet of the data
So the date picker is based on the ReportingDate column. The rows of the matrix consist of Region and Country and the values are the sum of Monday-Friday.
Any guidance would be greatly appreciated.
Edit: The day names are not obtained via an expression in SSRS. They carry over from the column headers in the data set.

Assuming you have some expression to get the actual day name already, you can leave that bit as it is.
Now, double click the column header "cell"/textbox to get a cursor in there, then click at the end of the existing fields/expression.
Now just put a space in and then right-click and choose "Create Placeholder". The placeholder dialog will appear.
This placeholder acts almost like a separate textbox to you can put whatever you want in there, click the '[fc]' button next to the Value property and then set this to whatever you want, e.g. =Fields!ReportingDate.Value.
Now go to the "number" tab on the same dialog box and set the format to the required date format.
If you want to edit this later, just double click the cell again but this time right-click the placeholder and choose properties.
The other way of doing this would be to add another row to your header and set that to be the date instead but then you have to mess around removing borders etc., sometimes this can be easier if layout is an issue but you have a couple of options at least now.

I managed to figure it out with the help of the following post.
These are the steps I followed
Get the date of the first day of the current week (Sunday's date) using the formula explained in the link
DateAdd("d",1- DatePart("w", CDate(Parameters!ReportingDate.Value)), CDate(Parameters!ReportingDate.Value))
Use DateAdd to add the corresponding number of days to get to a required weekday. That is for Monday add 1, Tuesday add 2,...
DateAdd("d",1,DateAdd("d",1- DatePart("w", CDate(Parameters!ReportingDate.Value)), CDate(Parameters!ReportingDate.Value)))
Format datetime to date and add new line to insert date below day name
="Monday" + Environment.NewLine + FormatDateTime(DateAdd("d",1,DateAdd("d",1- DatePart("w", CDate(Parameters!ReportingDate.Value)), CDate(Parameters!ReportingDate.Value))), DateFormat.ShortDate)

Related

SSRS Target Line

I would like to re-create a line chart in SSRS like the one below (created in excel)
Target vs Revenue
I can re-create the running value (green line - revenue) but I have no idea how to do the straight target line (grey one) that should end at the end of the current month. The value for this line comes from a text parameter (I type in the target for current month manually), so ideally this should be a running value of the parameter number divided by the number of days for this month ending on the last day.
Can I have an angled StripLine to achieve that or shall I use an expression, if so, can you help me to build it, please?
Thank you for your help.
This answer assumes you know what month you are running the report for and you can therefore determine the number of days in that month. I won;t cover that here, ask a new question if you can't do that.
To create your target line, open your dataset properties, click the 'Fields' tab and Add a new field.
Call the new field Target or whatever you want and hit the fx button next to field source. Set the field source to following expression.
=(Parameters!Target.Value/31) * DAY(Fields!myRevenueDateField.Value)
You will just need to swap out the 31 for the actual number of days in the month, and the correct date fields from your dataset.
I used some sample data in my test with a target of 3000 and got the following result.

SSRS select parameter month and change par. first and last day of this month

i need to create parameter list of months and then (after select) recalculate two others paramateres in date format ([first day] and [last day]) of this month, can you please help me?
You are querying a database server to generate the list of months, although there's no need to do that. I suggest to rather create a list of months in the report and let the report calculate the month's names, so the language depends on the Language setting of the report (which can be the language configured in the user's browser).
For example, to calculate the Label for the Value 1, use an expression like =MonthName(1).
The Parameters FirstDay and LastDay (or just the values whenever you need them) can be calculated using these expressions:
FirstDay: =DateSerial(Today.Year, Parameters!Month.Value, 1)
LastDay: =DateSerial(Today.Year, Parameters!Month.Value, 1).AddMonths(1).AddDays(-1)

Change the value of a date field

Is there a way to take a field(DateRequired for example) and adjust the date being displayed to show differently from the actual date? For example, if the date in DateRequired is 7/20/17, I would like it to display 7/13/17, a week before the actual date.
Yeah, SSRS utilizes VB as a language for custom expressions and code that you create in the report. If you right-click on the object that your date is in (textbox/table cell etc...) and go to the "Expression" wizard, you will be able to modify your date field.
To add or remove a specific amount of time to a date, utilize the DateAdd function.
=DateAdd(DateInterval.Day, -7, CDate(Fields!YourDateColumn.Value))

Date/Time formatting in access textbox

I have an issue, and believe its simple to resolve but cant work out how.
My table, which has showing both date & time can not be amended because that is how I receive my data.
Ive changed the format in the table design to short date and it shows fine, it hides the time.
I also changed the textbox that displays the date to short date but its still showing both the date and time, why?
Primarily, I have another textbox that I want to calculate the table date + 30, my expression used is:
=[text5]+30
The textbox is displayed blank.
Any help?
It sounds like your date field is linked as text. So convert to Date:
=DateValue([OpenedDate])
and for the +30 date:
=DateAdd("d",30,DateValue([OpenedDate]))
However, there is no way that:
? DateValue(Now() + 30)
can show today's date. It will show 30 days ahead of today.

SSRS Report, dates to auto generate the last 3 weeks,

I have a report that I need to show the last 4 weeks of totals that I would like them to be 'week ending 18/12, 11/12 , 4/12 and 27/11 etc'
is there a way that I can hard code these into my report expression so they will auto change every week.
About the date formatting issue : there should be 2 good options for this.
First option is to use the "Format" property of a component and enter d/MM.
Second option is to use the Format expression as such : =Format(Now(), "d/MM") where you have to replace the Now() with your date. Note that if you get an error with this expression, you might need to wrap it with a CDate : =Format(CDate(Now()), "d/MM")