I have a graph in SSRS which displays info from a SP. The SP displays the duration of a process we have that runs daily. looks something like:
Date | Duration
2015/09/23 | 00:21:32
2015/09/22 | 00:28:43
2015/09/21 | 00:25:54
....
I am trying to display this information in a bar graph in SSRS so the dates are displayed on the bottom, and the bar represents the duration.
I have gotten it to display the time, but it is displayed as:
12:21 AM
Instead of:
00:21:32
I have't worked with the graphs on SSRS much, but when I try to convert to time or minutes it either doesn't change, or is just changed to HH:MM:SS and doesn't actually display anything.
Any help on the matter would be great.
Shortly after posting this I figured it out.
I converted the duration to Time(0) within the SP, and displayed the un-Aggregated version of the duration on the bar.
Then right clicked the vertical axis > properties > Number.
Then changed the Custom to HH:mm.
Is now properly displaying it as 00:20 up the side.
Related
I am currently using Microsoft Visual Studio Express 2013 for Windows desktop with an SQL back-end. I am trying to run an SQL query that will have the date time in format "yyyy-mm-dd." My problem is I need to see all entries from that date. Currently my date time picker keeps giving me a time with my selection. I need to remove the time portion. I tried a couple of solutions from the web but when I try and display the date time picker in a message box to see what the value is it says false. I am not sure how to change the output value in the custom field to remove this. Here is my code.
This is in on my load event:
'date time picker set up
DTPPromiseDate.Format = DateTimePickerFormat.Custom
DTPPromiseDate.CustomFormat = "yyyy-MM-dd"
Then in a button click event, is a message box to display what was selected in the date time picker. I want to get my message box working correctly before I try and run SQL queries with it.
MsgBox(DTPPromiseDate.Value)
-------------------------UPDATE-----------------
This code appeared as I wanted it to but I am still trying to work it into my query.
DTPPromiseDate.Value.ToString("yyyy-MM-dd")
Apply the formatting string that you used in the picker's custom format to the message box text as well.
After placing Timestamp control on my panel, I've changed it's properties to display only time, as I don't need date part.
Value shown on this control is, as expected, 00:00:00, but if I press up button I get 01:00:01, 01:00:02, ..., or if I press down button, I get 00:59:59, 00:59:58 and so on.
If I write 01:00:00 inside a text box of the control, it automatically switches back to 00:00:00.
If I change timestamp value to double, I get 0 for 00:00:00, -1 for 00:59:59, and 1 for 1:00:01.
So it seems as if this control uses 01:00:00 as a base time. Inside it's properties I've found minimum value of 01:00:00,000 1600-01-01. Changing it to 00:00:00 doesn't give expected result.
Is there any way for this control to work properly as a normal time span control ?
I don't know if the behavior is correct or not, but I can explain it.
The problem is that you're using absolute time. In absolute time, LV uses the first midnight of 1904 UTC as the epoch (the zero value) and when you have that value it displays it as all zeros. Once you change it, the display goes back to normal. The reason you're seeing 1:00:00 as the base is because you're in the GMT+1 timezone and LV automatically fixes the display when the value is not zero.
What I would suggest is replacing the timestamp control with a numeric control, going to the format page in the properties and changing the control to display relative time.
Alternatively, if you do want the time to be absolute, then set the value of the control to the correct timestamp using a local variable before starting.
I am using dojo 1.6 and using dijit.calendar in a project and it's working great except for the goal of colorizing a selected grid cell. I have three innerHTMLs that are being manipulated by the calendar clicks. No problem there.
dijit.calendar's behavior is to highlight a gridcell (calendar day) as blue when clicked and when another gridcell is clicked, it then turns that blue.
What I'd like to do is colorize the cell a custom color when it's clicked and have it persistent.
Specifically the calendar is for a project that has an official date (blue), start date (green) and an end date (red).
I'm not even aware that there is a way to colorize a specific gridcell in dijit.calendar. Has anyone successfully done this or have a pointer to send me in the right direction?
Edit below:..
OK folks, I have a pretty good lead on where to go with this thanks to Philippe below. Philippe's solution will color the cell EXACTLY as intended (so he's got the answer karma). Turns out that if a selected grid cell is red and I switch to the month to pick a subsequent date, the cell stays red.
I have most of it figured out. I can get, say, the first couple of dates successfully colored but if I have to do something like put in a third date in the next month and change the calendar, the cells stay colored. So there's going to have to be a way to change my color change to a distinct value that corresponds with the actual date.
I know that onChange that the only argument returned is the Date itself like this (using debug.console in Firebug).....
[Date {Wed Jan 18 2012 00:00:00 GMT-0500 (EST)}]
I inspected the code through Firebug and noticed in that same cell that the code looks like this....
<td role="gridcell" class="dijitCalendarSelectedDate dijitCalendarCurrentMonth dijitCalendarDateTemplate" dijitdatevalue="1326866400000" style="background-color: green;" tabindex="0"><span class="dijitCalendarDateLabel">18</span></td>
That distinct value seems to be "dijitdatevalue".
I suppose I could follow a chain of ......
on click, store the "dijitdatevalue" of the first date in a hidden field (as well as the second and third dates)
Then go back and set the background-color of the corresponding dijitdatevalue to blue, green or red.
Question now is how to return the dijitdatevalue string to a hidden field. I'll update this post again as I figure out the answer.
Janie
If you look at the widget code you'll see a private method called _onDayMouseDown which is responsible for turning the cell blue...
You can add your custom code to that function through dojo.connect, like this :
dojo.connect(dijit.byId('calendar1'), "_onDayMouseDown", function(/*Event*/ evt){
var node = evt.target.parentNode;
dojo.style(node, "backgroundColor", "green");
});
Otherwise, if you use dojo 1.7, you may give a try to the MultiSelectCalendar
The pie chart is driving me nuts...Excuse me if I sound ignorant but I have figured out the other RS charts with relative ease, and this is the first time I have had to use the Reporting Services pie chart.
I have a dataset:
Columns:
ChildId int
AssessmentType varchar
Score int
All I want is to have a pie chart that displays the percent of the whole for each assessment type. So if I had 10 records returned with the following:
2 "THIS" Assessment Types
5 "THAT" Assessment Types
3 "THEOTHER" Assessment Types
I would want the pie chart to show that the "THIS" Assessment peice of the pie is 20%, the "THAT" is 50%, "THEOTHER" as 30%, but I cannot figure out how to set it up. Can any one help me out on this, or refer me somewhere. I have been looking for some time and can't find any pages that have helped me with this control.
I figured this out...To show the percentage:
Right click on the chart and click on properties.
Go the the Data table, select your "[Value]" and click edit.
Go to the Point Labels tab and check "Show point labels".
In the format code enter P
Edit the expression and calculate your percentage. In my example I would use the code below.
=Count(Fields!ChildId.Value) / Count(Fields!Childid.Value, "MyDataset")
The problem I was having is that I was filtering the data set at the chart level with a filter expression. So when I was trying to calculate the percentage using the code below my numbers were getting thrown off. The filter is not applied the dataset count when retrieved like I was doing it.
Count(Fields!Childid.Value, "MyDataset")
Working on a handy program for my boss at work as a summer project in between semesters both to make life easier for her, and to practice and improve my skills. Intent is to allow her to quickly and easily calculate the hours and minutes the person worked. The form itself has a series of text boxes for the Clock in and Clock out time for each day that week. Currently it attempts to convert the txtbox text into a Date variable, then .Subtract()'s the start from the end and stores it in a rolling total variable which is displayed at the bottom of the form. I can't help but think there is a better way of going about doing this, and I'm absolutely certain that having the below block of code 21 times (7 days, 3 shifts) is inefficient.
Dim StartTime As Date
Dim EndTime As Date
Dim Worked As System.TimeSpan
Dim WorkedTotal As System.TimeSpan
If chkFirst.Checked = True Then
StartTime = CDate(txtMonStart.Text)
EndTime = CDate(txtMonEnd.Text)
EndTime = EndTime.AddHours(12)
Worked = EndTime.Subtract(StartTime)
lblMonWork.Text = Worked.ToString()
WorkedTotal += Worked
Currently it works, mostly. The user has to enter the ":" in the time input, and if the total exceeds 24 hours, it displays a day column (40 hour 12 min work week displays as 1.16:12). I'd like to eliminate both of these unplanned features and allow for my input validation to take place when the focus changes to another box. A changing bgcolor would indicate an invalid input.
Any bright ideas?
Instead of using TextBox for the time input, use DateTimePicker, just change the Format property to Time.
Handle the Validating event of the DateTimePicker and if it's invalid just set e.Cancel = False, that way they can't save changes unless it's valid. Or if you want them to be able to leave the DateTimePicker and just change the colour, just handle the ValueChanged event instead.
Regarding your code sample, I haven't really looked at the logic of it, but instead of having the same code 21 times, just move the code into a separate function and then call that function with the start and end times as parameters and it can return the workedtime as it's return value.
I'm not sure what your UI looks like but if you're repeating the start time and end time input control multiple times as well it might be worth looking at creating your own usercontrol that can contain one each of the start and end time controls, and then you could have the validation be inside that user control so you don't have to have lots of event handlers etc.