Click to See Complete Forum and Search --> : Help with Generating turnaround time report!


BabyAngel
April 14th, 2009, 07:56 PM
hey guys..i've got this task to work on..

what i am suppose to do here is - get the openDate(when the ticket was created) and the resolveDate(when the ticket issue was solved) from the database
and use this formula - TurnAroundTime = ResolveDate - OpenDate

my report UI consist of a texbox where u can search for the ticketID and get the data..
the data displayed will be the openDate and the ResolveDate..

with this 2 records, i want to get the turnaround time so i have another button which is calculate
when i click on calculate i want the system to use the formula to get the TurnAroundTime..

so behind my button i have this code:

Protected Sub btnCalculateTurnArnd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCalculateTurnArnd.Click
Dim clsTickets_Obj As New clsTickets
Dim Time As Double = 0.0
Time = clsTickets_Obj.CalculateTurnArndTime(Convert.ToString(ID))

End Sub
End Class


and i have called the CalCulateTurnArndTime function at my tickets class which is this:

Public Function CalculateTurnArndTime(ByVal ID As Integer) As Integer
Dim TurnArndTime As Double
TurnArndTime = ResolveDate - OpenDate
Return TurnArndTime
End Function


but i cant get it to work..i get the error "Input string was not in correct format" at the line Time = clsTickets_Obj.CalculateTurnArndTime(Convert.ToString(ID))

anybody help me pls..thanx!

DataMiser
April 14th, 2009, 08:05 PM
You have it defined as an integer in your function but are converting it to a string when you pass it in. This is a problem. I am assuming that ID is already in integer format and if so you need to drop the covert.tostring() and just pass ID instead. Either that or change the parameter in the function to a string instead of integer.

Then again you are not using ID in the function so why are you requiring it as a parameter?
You also define turnaroundtime as double but try to return it in an integer. You need to match your variables.

Where does ResolvedDate and OpenDate get defined and set? Normally these would be the kinds of things that would be passed into a function as parameters.

It is always a good idea to make variables which are to be used in a function either local variables or passed as parameters into the function. When you use public vars it makes it difficult to determine what is going on, Code is hard to read and the functions are difficult to reuse.

BabyAngel
April 14th, 2009, 09:30 PM
hey ya..thanx for replying..but i managed to solve this issue..(:

i've got another problem..

i have an email template for the supportstaff to see the ticket details..
so with that result,when the supportstaff clicks on the TicketID,it directs them to the ticket details page...

i was able to direct them to the ticketdetails page with the ticketID displayed in the querystring..

and on the page,i want the details of that particular ticketID shown in the querystring to be displayed..

say,the supportstaff click on the ticketID 100 on the email page and it directs them to the ticket details page..and the TicketID=100 is displayed in the querystring..

and i want the details of the ticketID 100 to be displayed on that page..

how do i do that??

DataMiser
April 14th, 2009, 10:43 PM
I am not sure I understand the question? Are you wanting to create a link in the email that pulls up a web site using the query string or are you sayign you want it to interact with your [pc based?] application?

BabyAngel
April 14th, 2009, 10:59 PM
yes i have a link in the email which is the ticketID...when the supportSTaff clicks on the link,it will direct them to the next page where the ticketDetails should be displayed of what the supportstaff has click..

for example,if the suppotstaff clicks on the TicketID 100, it must direct them to the ticket details page with all the data retrieved from the database..

DataMiser
April 15th, 2009, 12:26 AM
Still do not understand the question here. If you just need to know how to do the query string portion you simply add

?TicketID=100

to the end of your link

For example it might look something like this

MySite.Com/TicketStatus.ASP?TicketID=100

BabyAngel
April 15th, 2009, 12:44 AM
yess i'm able to do this..but i want to display the other records like subject and all those for that particular ID in the query string..

dglienna
April 15th, 2009, 02:00 AM
That's what you'd put on THAT page, which would show the results of your query. Web Forms can have pages or sections

BabyAngel
April 15th, 2009, 08:07 PM
anyway guys thanx for replying..

i managed to solve this issue already..

thanx!

dglienna
April 15th, 2009, 10:08 PM
anyway guys thanx for replying..

i managed to solve this issue already..

thanx!

Well, you *COULD* post the solution, to help the next person that searches the forum for their problem...