I have a chart report that displaying monthly data and i want to display previous and next month data by clicking previous and next month.
How to display data in chart by clicking previous and next month.
Add a parameter to the report to specify the month. Create two text items in the RDL for this report for previous and next. Configure the 'jump to' item for these two tems to invoke this same report with correct value for the month deduced from the month value in the current report. It will be month - 1 for prev and month + 1 for next. In short, you will be calling the same report for both the prev, next and for the current month.
not sure what environment you are in, but you could use the following SQL to get you the next/previous months (using oracle). Use this as your starting point for building your query.
next button: select to_char(sysdate,'MM')+1 from dual
previous button: select to_char(sysdate,'MM')11 from dual
Once you get your requested month, build the remaining resultset.
Related
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)
How can I build a report when I select eg. Apr-Jun22 to show in a matrix Apr-Jun22 and another matrix Apr-Jun21 automatically OR either have a current period parameter and previous period parameter on selection - which ever way to have the two periods in one report on any date selection ?
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.
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)
Fairly new to MS Access (been at it for about 6 or 7 months and pretty much self taught, I bow at the alter of Google and Stackoverflow a lot) and am working on a form for a database that is to allow the user to create reports and dictate what they want in the report.
How it's set up is the user has one list that's pre-populated and doesn't change where they select whether the report will show projects that happened during a certain fiscal period, non-project related trips (we'll call them NPTs for now) that happened during a certain fiscal period, or a certain project series.
The second list (also prepopulated and unchangeable) only activates if the first or second item in the first list are selected. It allows the user to select the fiscal period and gives the options of either: fiscal year, fiscal quarter, month, or year-on-year comparison.
Once an item in both of those lists are selected it populates the list of one or two comboboxes with options based on what's available in the table that it's pulling from.
The first combobox will always be populated and visible, what it's populated with alters. If the fiscal year, fiscal quarter, month or year-on-year options are selected the first combobox will be populated with the available fiscal years, and if the project series option is selected then it's populated with a list of series names.
There is a second combobox but it isn't relevant to my question so I'll leave details about it out.
My problem comes from the first combobox. Now when you open a new instance of the form no data type is assigned to the combobox but let's say that a user wants to create a report by projects in a fiscal year and he/she selects a fiscal year in the combobox then changes their mind and decides to do a report by project series. When you go to try and select a project series name in the combobox that was populated with fiscal years earlier an error message pops up stating that you're trying to input text into a numeric data type field.
So my question is, is there a way to programmatically change the allowed data type for the first combobox in the AfterUpdate Sub of the first list?
Here's an example of what I have for the first list AfterUpdate Sub (RptByType is the first list):
Me.combobox1.RowSource = Switch(RptByType = Project, _
"SELECT DISTINCT Proj.FiscYr FROM Proj ORDER BY Proj.FiscYr DESC;", _
RptByType = Trips, "SELECT DISTINCT NPT.FiscYr FROM NPT ORDER BY NPT.FiscYr DESC;", _
RptByType = Projseries, "SELECT DISTINCT Proj.SeriesNm FROM Proj;")
And again FiscYr is in an Integer format, while SeriesNm is in a String format, also combobox1 is not a bound field