Yannie
asked on
Unable to refresh graph created by OWC
Dear all,
I need help urgently.
I have a file called quarter1.asp with a graph1.asp included inside. However, in quarter1, I can choose to direct to quarter2.asp or quarter3.asp by using response.Redirect in choosequarter.asp. So It functions in such a way from
quarter1.asp -> choosequarterlist.asp -> quarter1.asp or quarter2.asp or quarter3.asp(depending which i chose to go from the initial quarter1.asp)
However i'm unable to load the graph successfully as it seems to be always selected at current year's graph even I have choose other year's graph.
The parameters passed to different pages are correct.
Only when I hit F5 then the graph can be loaded again.
I had also tried putting this below but doesn't help..
Response.Expires = -1
Response.AddHeader "pragma", "no-cache"
Response.CacheControl = "no-cache"
Response.CacheControl = "no-store" ' HTTP 1.1 Cache-Control header : prevent all caching of a particular Web resource
Response.CacheControl = "no-cache" ' HTTP 1.1 Cache-Control header : prevent all caching of a particular Web resource
Response.AddHeader "Pragma", "no-cache" ' (META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE")
Can anyone help this asap?!
I need help urgently.
I have a file called quarter1.asp with a graph1.asp included inside. However, in quarter1, I can choose to direct to quarter2.asp or quarter3.asp by using response.Redirect in choosequarter.asp. So It functions in such a way from
quarter1.asp -> choosequarterlist.asp -> quarter1.asp or quarter2.asp or quarter3.asp(depending which i chose to go from the initial quarter1.asp)
However i'm unable to load the graph successfully as it seems to be always selected at current year's graph even I have choose other year's graph.
The parameters passed to different pages are correct.
Only when I hit F5 then the graph can be loaded again.
I had also tried putting this below but doesn't help..
Response.Expires = -1
Response.AddHeader "pragma", "no-cache"
Response.CacheControl = "no-cache"
Response.CacheControl = "no-store" ' HTTP 1.1 Cache-Control header : prevent all caching of a particular Web resource
Response.CacheControl = "no-cache" ' HTTP 1.1 Cache-Control header : prevent all caching of a particular Web resource
Response.AddHeader "Pragma", "no-cache" ' (META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE")
Can anyone help this asap?!
i allways put this code in my page and work fine, try putting this on the begining of your pages
choosequarterlist.asp, quarter1.asp, quarter2.asp and quarter3.asp
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
choosequarterlist.asp, quarter1.asp, quarter2.asp and quarter3.asp
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
ASKER
It's still the same after putting this in..i even put it on the graph page itself..
But still unable to refresh..any ideas?
But still unable to refresh..any ideas?
can you put the ode of quarter1.asp to see what it does?
or put this code in your page
response.write(selQuarter)
response.write(selYear)
response.end
before
if selYear = "" then
and post here the output
or put this code in your page
response.write(selQuarter)
response.write(selYear)
response.end
before
if selYear = "" then
and post here the output
ASKER
This is quarter1.asp codes..In it has Graph1...it's always the graph1.asp that cannot be reloaded..
<%
'DO NOT CACHE THIS PAGE!
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
MasterID = request("MasterID")
'MasterID = request.QueryString("Maste rID")
selYear = request("selYear")
currentyear= year(now())
if selYear = "" then
selYear = currentyear
end if
currentmth= month(now())
if selMonth = "" then
selMonth = currentmth
end if
%>
<script language="javascript">
<!-- Begin
//function redirTimer() {
// window.open('quarter1.asp? MasterID=' +MasterID+ '&selYear= '+selYear) ;
//setTimeout(window.open(" http://www.cnn.com","cnn",he ight="400" ,width="40 0",toolbar ="no",scro llbars="ye s",resizab le="no",me nubar="no" ), redirTime);
// }
//END Script-->
//if (!location.search || ( location.search && location.search.indexOf('d one') == -1)) location = location.href+'?done';
</script>
<html>
<head>
<title>Oil Consumption Report</title>
<link rel="stylesheet" type="text/css" href="Style.css">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
</head>
<body>
<!--#include file="conn.asp"-->
<%
'========================= ========== ========== ========== ====
'Calculate the number of days in a particular month
'========================= ========== ========== ========== ====
'=======Calculate the number of days for the requested month=========
function getDaysInMonth(iMonth,iYea r)
Select Case (iMonth)
'// If the requested month is April, June, Sept, Nov, number of days in that month is 30 days
Case 4,6,9,11
getDaysInMonth = 30
'// If the requested month is Feb, number of days in that month is either 28 or 29
Case 2
if (iYear Mod 4 = 0 And iYear Mod 100 <> 0) Or iYear Mod 400 = 0 Then
getDaysInMonth = 29
Else
getDaysInMonth = 28
End if
'// For other cases, number of days in that month is 31 days
Case Else
getDaysInMonth = 31
End Select
End function
%>
<%
query_displayVessel = "SELECT * FROM Vessel WHERE MasterID="&MasterID&""
Set rs_displayVessel = Server.CreateObject("ADODB .Recordset ")
Set rs_displayVessel = conn.Execute(query_display Vessel)
%>
<%
If Request("quarter1.asp?Mast erID="&Mas terID&"&se lYear="&se lYear&"&re load") Then Response.Write "window.location.reload(); "
%>
<table width="72%" border="1" bordercolor="#cccccc" cellspacing="0" cellpadding="5" align="center">
<tr>
<th align="left" height="40" colspan="9"><b><center>
<%=rs_displayVessel("Vesse lName")%> LUB OIL CONSUMPTION REPORT
</center>
<br>
<center><form name="quarter1" method="post" action="quarter1.asp">
<font size ="2" face="Verdana, Arial, Helvetica, sans-serif">Year:</font>
<select name="selYear" style="font-size:12px">
<option selected value="<%=selYear%>"><%=se lYear%></o ption>
<% for k=currentyear-4 to currentyear %>
<option value="<%=k%>"><%=k%></opt ion>
<% next %>
</select>
<strong> </strong><fo nt size="2" face="Verdana, Arial, Helvetica, sans-serif">Sort by:</font>
<select name="selQuarter" style="font-size:12px">
<option select value="001">Jan - Apr</option>
<option value="002">May - Aug</option>
<option value="003">Sept - Dec</option>
</select>
<input type="hidden" name="MasterID" value="<%=MasterID%>">
<input type="submit" name="btn_submit" value="Go" style="width:40px; font-size:10px"> &nbs p; &n bsp;
</form>
</center>
</th>
</tr>
</table>
<p>
<!--#include file="graph1.asp"-->
<%
Dim MonthArray(4)
Dim i ' i is monthcount
i = 1
For j = 0 to 3
i = 1 + j
%>
<p>
<table width="72%" border="1" bordercolor="#cccccc" cellspacing="0" cellpadding="5" align="center">
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<tr>
<th align="left" height="40" colspan="9"><b><center>
<%=UCASE(monthName(i))%>&n bsp;<%=sel Year%>
</center>
</b></th>
</tr>
<tr bgcolor="e8e8e8">
<td width="19%" class="blue">LOGDATE</td>
<td width="18%" class="blue"><div align="center">AT SEA (HRS)</div></td>
<td width="26%" class="blue"><div align="center">HFO CONSUMPTION (MT)</div></td>
<td width="37%" class="blue"><div align="center">ME LUB OIL CONSUMPTION (LTRS)</div></td>
</tr>
<tr>
<%
query_getReport = "SELECT Main_Eng_Log.MASTERID, Main_Eng_Log.LOGDATE AS expr1, isnull(AT_SEA_1,0) AT_SEA_1, isnull(FULL_AWAY_1,0) FULL_AWAY_1, isnull( ME_LUB_OIL_SUMP_32,0) ME_LUB_OIL_SUMP_32, Consumption_Report.LOGDATE AS LOGDATE1 FROM Main_Eng_Log full join Consumption_Report ON Main_Eng_Log.LOGDATE = Consumption_Report.LOGDATE AND Consumption_Report.MASTERI D = Main_Eng_Log.MasterID WHERE (Consumption_Report.MASTER ID = " & MASTERID & ") AND (YEAR(Consumption_Report.L OGDATE) = " & selYear & ") AND (MONTH(Consumption_Report. LOGDATE) = " & i & ") ORDER BY Main_Eng_Log.LOGDATE "
Set rs_getReport = Server.CreateObject("ADODB .Recordset ")
Set rs_getReport = conn.Execute(query_getRepo rt)
dim iDay
dim iMonth
dim iYear
iDay = 1
if not rs_getReport.eof then
while NOT rs_getReport.EOF
iMonth = month(rs_getReport("LOGDAT E1"))
iYear = year(rs_getReport("LOGDATE 1"))
'while the day doesnt exist, will show row.
while iDay <> day((rs_getReport("LOGDATE 1")))
%>
<tr><td class="black"><%=iDay%>/<% =month(rs_ getReport( "LOGDATE1" ))%>/<%=ye ar(rs_getR eport("LOG DATE1"))%> </td>
<td class="black"><center>0</c enter></td >
<td class="black"><center>0</c enter></td >
<td class="black"><center>0</c enter></td >
</tr>
<%
iDay = iDay + 1
Wend
%>
<td class="black"><%=day((rs_g etReport(" LOGDATE1") ))%>/<%=mo nth((rs_ge tReport("L OGDATE1")) )%>/<%=yea r((rs_getR eport("LOG DATE1")))% ></td>
<td class="black"><center><%=r s_getRepor t("AT_SEA_ 1")%></cen ter></td>
<td class="black"><center><%=r s_getRepor t("FULL_AW AY_1")%></ center></t d>
<td class="black"><center><%=r s_getRepor t("ME_LUB_ OIL_SUMP_3 2")%></cen ter></td>
</tr>
<%
iDay = iDay + 1
rs_getReport.MoveNext
Wend
%>
<%
dim iDaysInMonth
iDaysInMonth = getDaysInMonth(iMonth,iYea r)
while (iDay <= iDaysInMonth)%>
<tr><td class="black"><%=iDay%>/<% =iMonth%>/ <%=iYear%> </td>
<td class="black"><center>0</c enter></td >
<td class="black"><center>0</c enter></td >
<td class="black"><center>0</c enter></td >
</tr>
<%
iDay = iDay + 1
Wend
%>
<%
query_getSum = "SELECT SUM(FULL_AWAY_1) AS SFA, SUM(ME_LUB_OIL_SUMP_32) AS SMLOC FROM Consumption_Report WHERE Masterid="&MasterId&" AND year(LOGDATE)="&selYear&" AND month(LOGDATE)="&i&" "
Set rs_getSum = Server.CreateObject("ADODB .Recordset ")
Set rs_getSum = conn.Execute(query_getSum)
query_getSum1 = "SELECT SUM(AT_SEA_1) AS SAS FROM Main_Eng_Log WHERE Masterid="&MasterId&" AND year(LOGDATE)="&selYear&" AND month(LOGDATE)="&i&" "
Set rs_getSum1 = Server.CreateObject("ADODB .Recordset ")
Set rs_getSum1 = conn.Execute(query_getSum1 )
SAS = rs_getSum1("SAS")
SFA = rs_getSum("SFA")
SMLOC = rs_getSum("SMLOC")
if SFA <> 0 then
A_SFA = ROUND((SFA/SAS),5)
A_SMLOC = ROUND((SMLOC/SAS),5)
else
A_SFA = 0
A_SMLOC = 0
end if
%>
<tr>
<td width="18%" align="right" bgcolor="e8e8e8" class="blue">MTHLY CONS</td>
<td width="19%" align="center" class="black"><b><%=rs_get Sum1("SAS" )%></b></t d>
<td width="26%" align="center" class="black"><b><%=rs_get Sum("SFA") %></b></td >
<td width="37%" align="center" class="black"><b><%=rs_get Sum("SMLOC ")%></b></ td>
</tr>
<tr>
<td class="blue" bgcolor="e8e8e8" align="right">AVERAGE CONS</td>
<td align="center" class="black"></td>
<td align="center" class="black"><b><%=A_SFA% ></b></td>
<td align="center" class="black"><b><%=A_SMLO C%></b></t d>
</tr>
</table>
<%
rs_getSum.close()
rs_getSum1.close()
%>
<%else%>
<table width="72%" border="1" bordercolor="#cccccc" cellspacing="0" cellpadding="5" align="center">
<tr>
<td colspan="14" height="60" align="center" class="black"><strong>No data log found for the month.</strong></td>
</tr>
</table>
<%end if%>
<%next%>
<%
if Request.Form("btn_submit") = "Go" then
response.Redirect("chooseq uarterlist .asp?Maste rID="&Mast erID&"&sel Year="&req uest("selY ear")&"&se lQuarter=" &request(" selQuarter ")&"")
end if
%>
<!--#include file="disconn.asp"-->
</body>
</html>
<%
'DO NOT CACHE THIS PAGE!
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
MasterID = request("MasterID")
'MasterID = request.QueryString("Maste
selYear = request("selYear")
currentyear= year(now())
if selYear = "" then
selYear = currentyear
end if
currentmth= month(now())
if selMonth = "" then
selMonth = currentmth
end if
%>
<script language="javascript">
<!-- Begin
//function redirTimer() {
// window.open('quarter1.asp?
//setTimeout(window.open("
// }
//END Script-->
//if (!location.search || ( location.search && location.search.indexOf('d
</script>
<html>
<head>
<title>Oil Consumption Report</title>
<link rel="stylesheet" type="text/css" href="Style.css">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
</head>
<body>
<!--#include file="conn.asp"-->
<%
'=========================
'Calculate the number of days in a particular month
'=========================
'=======Calculate the number of days for the requested month=========
function getDaysInMonth(iMonth,iYea
Select Case (iMonth)
'// If the requested month is April, June, Sept, Nov, number of days in that month is 30 days
Case 4,6,9,11
getDaysInMonth = 30
'// If the requested month is Feb, number of days in that month is either 28 or 29
Case 2
if (iYear Mod 4 = 0 And iYear Mod 100 <> 0) Or iYear Mod 400 = 0 Then
getDaysInMonth = 29
Else
getDaysInMonth = 28
End if
'// For other cases, number of days in that month is 31 days
Case Else
getDaysInMonth = 31
End Select
End function
%>
<%
query_displayVessel = "SELECT * FROM Vessel WHERE MasterID="&MasterID&""
Set rs_displayVessel = Server.CreateObject("ADODB
Set rs_displayVessel = conn.Execute(query_display
%>
<%
If Request("quarter1.asp?Mast
%>
<table width="72%" border="1" bordercolor="#cccccc" cellspacing="0" cellpadding="5" align="center">
<tr>
<th align="left" height="40" colspan="9"><b><center>
<%=rs_displayVessel("Vesse
</center>
<br>
<center><form name="quarter1" method="post" action="quarter1.asp">
<font size ="2" face="Verdana, Arial, Helvetica, sans-serif">Year:</font>
<select name="selYear" style="font-size:12px">
<option selected value="<%=selYear%>"><%=se
<% for k=currentyear-4 to currentyear %>
<option value="<%=k%>"><%=k%></opt
<% next %>
</select>
<strong> </strong><fo
<select name="selQuarter" style="font-size:12px">
<option select value="001">Jan - Apr</option>
<option value="002">May - Aug</option>
<option value="003">Sept - Dec</option>
</select>
<input type="hidden" name="MasterID" value="<%=MasterID%>">
<input type="submit" name="btn_submit" value="Go" style="width:40px; font-size:10px"> &nbs
</form>
</center>
</th>
</tr>
</table>
<p>
<!--#include file="graph1.asp"-->
<%
Dim MonthArray(4)
Dim i ' i is monthcount
i = 1
For j = 0 to 3
i = 1 + j
%>
<p>
<table width="72%" border="1" bordercolor="#cccccc" cellspacing="0" cellpadding="5" align="center">
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<tr>
<th align="left" height="40" colspan="9"><b><center>
<%=UCASE(monthName(i))%>&n
</center>
</b></th>
</tr>
<tr bgcolor="e8e8e8">
<td width="19%" class="blue">LOGDATE</td>
<td width="18%" class="blue"><div align="center">AT SEA (HRS)</div></td>
<td width="26%" class="blue"><div align="center">HFO CONSUMPTION (MT)</div></td>
<td width="37%" class="blue"><div align="center">ME LUB OIL CONSUMPTION (LTRS)</div></td>
</tr>
<tr>
<%
query_getReport = "SELECT Main_Eng_Log.MASTERID, Main_Eng_Log.LOGDATE AS expr1, isnull(AT_SEA_1,0) AT_SEA_1, isnull(FULL_AWAY_1,0) FULL_AWAY_1, isnull( ME_LUB_OIL_SUMP_32,0) ME_LUB_OIL_SUMP_32, Consumption_Report.LOGDATE
Set rs_getReport = Server.CreateObject("ADODB
Set rs_getReport = conn.Execute(query_getRepo
dim iDay
dim iMonth
dim iYear
iDay = 1
if not rs_getReport.eof then
while NOT rs_getReport.EOF
iMonth = month(rs_getReport("LOGDAT
iYear = year(rs_getReport("LOGDATE
'while the day doesnt exist, will show row.
while iDay <> day((rs_getReport("LOGDATE
%>
<tr><td class="black"><%=iDay%>/<%
<td class="black"><center>0</c
<td class="black"><center>0</c
<td class="black"><center>0</c
</tr>
<%
iDay = iDay + 1
Wend
%>
<td class="black"><%=day((rs_g
<td class="black"><center><%=r
<td class="black"><center><%=r
<td class="black"><center><%=r
</tr>
<%
iDay = iDay + 1
rs_getReport.MoveNext
Wend
%>
<%
dim iDaysInMonth
iDaysInMonth = getDaysInMonth(iMonth,iYea
while (iDay <= iDaysInMonth)%>
<tr><td class="black"><%=iDay%>/<%
<td class="black"><center>0</c
<td class="black"><center>0</c
<td class="black"><center>0</c
</tr>
<%
iDay = iDay + 1
Wend
%>
<%
query_getSum = "SELECT SUM(FULL_AWAY_1) AS SFA, SUM(ME_LUB_OIL_SUMP_32) AS SMLOC FROM Consumption_Report WHERE Masterid="&MasterId&" AND year(LOGDATE)="&selYear&" AND month(LOGDATE)="&i&" "
Set rs_getSum = Server.CreateObject("ADODB
Set rs_getSum = conn.Execute(query_getSum)
query_getSum1 = "SELECT SUM(AT_SEA_1) AS SAS FROM Main_Eng_Log WHERE Masterid="&MasterId&" AND year(LOGDATE)="&selYear&" AND month(LOGDATE)="&i&" "
Set rs_getSum1 = Server.CreateObject("ADODB
Set rs_getSum1 = conn.Execute(query_getSum1
SAS = rs_getSum1("SAS")
SFA = rs_getSum("SFA")
SMLOC = rs_getSum("SMLOC")
if SFA <> 0 then
A_SFA = ROUND((SFA/SAS),5)
A_SMLOC = ROUND((SMLOC/SAS),5)
else
A_SFA = 0
A_SMLOC = 0
end if
%>
<tr>
<td width="18%" align="right" bgcolor="e8e8e8" class="blue">MTHLY CONS</td>
<td width="19%" align="center" class="black"><b><%=rs_get
<td width="26%" align="center" class="black"><b><%=rs_get
<td width="37%" align="center" class="black"><b><%=rs_get
</tr>
<tr>
<td class="blue" bgcolor="e8e8e8" align="right">AVERAGE CONS</td>
<td align="center" class="black"></td>
<td align="center" class="black"><b><%=A_SFA%
<td align="center" class="black"><b><%=A_SMLO
</tr>
</table>
<%
rs_getSum.close()
rs_getSum1.close()
%>
<%else%>
<table width="72%" border="1" bordercolor="#cccccc" cellspacing="0" cellpadding="5" align="center">
<tr>
<td colspan="14" height="60" align="center" class="black"><strong>No data log found for the month.</strong></td>
</tr>
</table>
<%end if%>
<%next%>
<%
if Request.Form("btn_submit")
response.Redirect("chooseq
end if
%>
<!--#include file="disconn.asp"-->
</body>
</html>
ASKER
This is how graph1.asp looks like which might clear any of ur doubts of the codes i used..
<table width="72%" border="1" bordercolor="#cccccc" cellspacing="0" cellpadding="5" align="center">
<tr>
<th align="left" height="40" colspan="9"><b><center>
<%=rs_displayVessel("Vesse lName")%> LUB OIL CONSUMPTION REPORT <%=selYear%>
</center></b>
</th>
</tr>
<tr align="center"><td>
<%
Sub CleanUpGIF(GIFpath)
Dim objFS
Dim objFolder
Dim gif
set objFS = Server.CreateObject("Scrip ting.FileS ystemObjec t")
set objFolder = objFS.GetFolder(GIFpath)
'Loop through each file in the GIFpath folder
for each gif in objFolder.Files
'Delete GIF files older than 10 minutes
if instr(gif.Name, ".gif") > 0 and _
DateDiff("n", gif.DateLastModified, now) > 10 then
objFS.DeleteFile GIFpath & "\" & gif.Name, True
end if
next
set objFolder = nothing
set objFS = nothing
End Sub
Call CleanUpGIF("\\oceanflow\ia t$\lubOilC onsump\rep orts\")
%>
<%
Dim Line1Val(4)
Dim LineVal(4)
Dim Val(4)
Dim monthCount
monthCount = 1
'blue for fuel oil
for j = 0 to 3
query_getReport1 = "SELECT (SUM(FULL_AWAY_1)) AS TFA, SUM(AT_SEA_1) as SAS, CASE WHEN SUM(AT_SEA_1) <> 0 THEN ((SUM(FULL_AWAY_1))/(SUM(A T_SEA_1))) ELSE 0 END AS AFA FROM Consumption_Report, Main_Eng_Log WHERE Main_Eng_Log.MasterId = Consumption_Report.MasterI D AND Main_Eng_Log.MasterId = "&MasterId&" AND Year(Main_Eng_Log.LOGDATE) = YEAR(Consumption_Report.LO GDATE) AND Year(Main_Eng_Log.LOGDATE) = "&selYear&" AND Month(Main_Eng_Log.LOGDATE ) = Month(Consumption_Report.L OGDATE) AND Month(Main_Eng_Log.LOGDATE ) = "&monthCount&""
Set rs_getReport1 = conn.Execute(query_getRepo rt1)
if not rs_getReport1.eof then
Line1Val(j) = rs_getReport1("AFA")
'response.write ((rs_getReport1("AFA"))&"- --")
'response.write(selYear&"& nbsp;")
' response.write(monthcount& " =")
else
Line1Val(j) = 0
end if
' red for lub oil
query_getReport = "SELECT (SUM(ME_LUB_OIL_SUMP_32)) AS TMELO, SUM(AT_SEA_1) as SAS, CASE WHEN SUM(AT_SEA_1) <> 0 THEN ((SUM(ME_LUB_OIL_SUMP_32)) /(SUM(AT_S EA_1))) ELSE 0 END AS AMELO FROM Consumption_Report, Main_Eng_Log WHERE Main_Eng_Log.MasterId = Consumption_Report.MasterI D AND Main_Eng_Log.MasterId = "&MasterId&" AND Year(Main_Eng_Log.LOGDATE) = YEAR(Consumption_Report.LO GDATE) AND Year(Main_Eng_Log.LOGDATE) = "&selYear&" AND Month(Main_Eng_Log.LOGDATE ) = Month(Consumption_Report.L OGDATE) AND Month(Main_Eng_Log.LOGDATE ) = "&monthCount&""
Set rs_getReport = conn.Execute(query_getRepo rt)
if not rs_getReport.eof then
LineVal(j) = rs_getReport("AMELO")
'response.write ((rs_getReport("AMELO"))&" ***")
else
LineVal(j) = 0
end if
monthCount = monthCount + 1
next
%>
<%
'label the months.
Val(0) = 1
Val(1) = 2
Val(2) = 3
Val(3) = 4
Dim ObjChart
Dim ChaCon
Dim ObjCharts
Dim SerCol
Dim objAxis
Dim objFont
Set ObjChart = Server.CreateObject("OWC.C hart")
Set ChaCon = ObjChart.Constants
Set ObjCharts = ObjChart.Charts.Add
'adding my line
Set SerCol = ObjCharts.SeriesCollection .Add
Set SerCol1 = ObjCharts.SeriesCollection .Add
'ObjCharts.Type = ChaCon.chChartTypeColumnCl ustered
ObjCharts.Type = ChaCon.chChartTypeLine
'this is in purple line
SerCol.Caption = "Fuel Oil Cons"
SerCol.SetData ChaCon.chDimCategories, ChaCon.chDataLiteral, Val
SerCol.SetData ChaCon.chDimValues, ChaCon.chDataLiteral, Line1Val
SerCol.Type = ChaCon.chChartTypeLineMark ers
'------------------------- ------
'this is my line in the graph
SerCol1.Caption = "Lub Oil Cons"
SerCol1.SetData ChaCon.chDimCategories, ChaCon.chDataLiteral, Val
SerCol1.SetData ChaCon.chDimValues, ChaCon.chDataLiteral, LineVal
'change from the default bar graph To a line
SerCol1.Type = ChaCon.chChartTypeLineMark ers
'------------------------- ---
'Title of graph
ObjChart.HasChartSpaceTitl e=True
'Legend in the graph
ObjChart.ChartSpaceTitle.C aption = "FO/LO CONSP / HR"
' Set a variable to the Value (X) axis.
Set axCategoryAxis = ObjChart.Charts(0).Axes(0)
' Set a variable to the Value (Y) axis.
Set axValueAxis = ObjChart.Charts(0).Axes(1)
' The following two lines of code enable, and then
' set the title for the category axis.
axCategoryAxis.HasTitle = True
axCategoryAxis.Title.Capti on = "LITRES / TONNES"
' The following three lines of code set the font
' for the values displayed on the category axis.
axCategoryAxis.Font = "Arial"
axCategoryAxis.Font.Size = 8
axCategoryAxis.Font.Bold = True
' The following two lines of code enable, and then
' set the title for the value axis.
axValueAxis.HasTitle = True
axValueAxis.Title.Caption = "MONTH" 'Put your Cation for Y-Axis
axValueAxis.Font = "Arial"
axValueAxis.Font.Size = 8
axValueAxis.Font.Bold = True
ObjChart.HasChartSpaceLege nd = True
ObjChart.ChartSpaceLegend. Position = ChaCon.chLegendPositionRig ht
ImagePath=server.mappath(" reports/oi lgraph.gif ")
ObjChart.ExportPicture ImagePath,"gif", 700, 400
Set ChaCon = nothing
Set ObjCharts = nothing
Set ObjChart = nothing %>
<Img src="reports/oilgraph.gif" width="700" height="400">
</td>
</tr>
</table>
<table width="72%" border="1" bordercolor="#cccccc" cellspacing="0" cellpadding="5" align="center">
<tr>
<th align="left" height="40" colspan="9"><b><center>
<%=rs_displayVessel("Vesse
</center></b>
</th>
</tr>
<tr align="center"><td>
<%
Sub CleanUpGIF(GIFpath)
Dim objFS
Dim objFolder
Dim gif
set objFS = Server.CreateObject("Scrip
set objFolder = objFS.GetFolder(GIFpath)
'Loop through each file in the GIFpath folder
for each gif in objFolder.Files
'Delete GIF files older than 10 minutes
if instr(gif.Name, ".gif") > 0 and _
DateDiff("n", gif.DateLastModified, now) > 10 then
objFS.DeleteFile GIFpath & "\" & gif.Name, True
end if
next
set objFolder = nothing
set objFS = nothing
End Sub
Call CleanUpGIF("\\oceanflow\ia
%>
<%
Dim Line1Val(4)
Dim LineVal(4)
Dim Val(4)
Dim monthCount
monthCount = 1
'blue for fuel oil
for j = 0 to 3
query_getReport1 = "SELECT (SUM(FULL_AWAY_1)) AS TFA, SUM(AT_SEA_1) as SAS, CASE WHEN SUM(AT_SEA_1) <> 0 THEN ((SUM(FULL_AWAY_1))/(SUM(A
Set rs_getReport1 = conn.Execute(query_getRepo
if not rs_getReport1.eof then
Line1Val(j) = rs_getReport1("AFA")
'response.write ((rs_getReport1("AFA"))&"-
'response.write(selYear&"&
' response.write(monthcount&
else
Line1Val(j) = 0
end if
' red for lub oil
query_getReport = "SELECT (SUM(ME_LUB_OIL_SUMP_32)) AS TMELO, SUM(AT_SEA_1) as SAS, CASE WHEN SUM(AT_SEA_1) <> 0 THEN ((SUM(ME_LUB_OIL_SUMP_32))
Set rs_getReport = conn.Execute(query_getRepo
if not rs_getReport.eof then
LineVal(j) = rs_getReport("AMELO")
'response.write ((rs_getReport("AMELO"))&"
else
LineVal(j) = 0
end if
monthCount = monthCount + 1
next
%>
<%
'label the months.
Val(0) = 1
Val(1) = 2
Val(2) = 3
Val(3) = 4
Dim ObjChart
Dim ChaCon
Dim ObjCharts
Dim SerCol
Dim objAxis
Dim objFont
Set ObjChart = Server.CreateObject("OWC.C
Set ChaCon = ObjChart.Constants
Set ObjCharts = ObjChart.Charts.Add
'adding my line
Set SerCol = ObjCharts.SeriesCollection
Set SerCol1 = ObjCharts.SeriesCollection
'ObjCharts.Type = ChaCon.chChartTypeColumnCl
ObjCharts.Type = ChaCon.chChartTypeLine
'this is in purple line
SerCol.Caption = "Fuel Oil Cons"
SerCol.SetData ChaCon.chDimCategories, ChaCon.chDataLiteral, Val
SerCol.SetData ChaCon.chDimValues, ChaCon.chDataLiteral, Line1Val
SerCol.Type = ChaCon.chChartTypeLineMark
'-------------------------
'this is my line in the graph
SerCol1.Caption = "Lub Oil Cons"
SerCol1.SetData ChaCon.chDimCategories, ChaCon.chDataLiteral, Val
SerCol1.SetData ChaCon.chDimValues, ChaCon.chDataLiteral, LineVal
'change from the default bar graph To a line
SerCol1.Type = ChaCon.chChartTypeLineMark
'-------------------------
'Title of graph
ObjChart.HasChartSpaceTitl
'Legend in the graph
ObjChart.ChartSpaceTitle.C
' Set a variable to the Value (X) axis.
Set axCategoryAxis = ObjChart.Charts(0).Axes(0)
' Set a variable to the Value (Y) axis.
Set axValueAxis = ObjChart.Charts(0).Axes(1)
' The following two lines of code enable, and then
' set the title for the category axis.
axCategoryAxis.HasTitle = True
axCategoryAxis.Title.Capti
' The following three lines of code set the font
' for the values displayed on the category axis.
axCategoryAxis.Font = "Arial"
axCategoryAxis.Font.Size = 8
axCategoryAxis.Font.Bold = True
' The following two lines of code enable, and then
' set the title for the value axis.
axValueAxis.HasTitle = True
axValueAxis.Title.Caption = "MONTH" 'Put your Cation for Y-Axis
axValueAxis.Font = "Arial"
axValueAxis.Font.Size = 8
axValueAxis.Font.Bold = True
ObjChart.HasChartSpaceLege
ObjChart.ChartSpaceLegend.
ImagePath=server.mappath("
ObjChart.ExportPicture ImagePath,"gif", 700, 400
Set ChaCon = nothing
Set ObjCharts = nothing
Set ObjChart = nothing %>
<Img src="reports/oilgraph.gif"
</td>
</tr>
</table>
ASKER
Hi Lennon..Did the
response.write(selQuarter)
response.write(selYear)
and everthing seems alrite..cos it's retrieving the right data each time i do the dropdownlist and i got wad i wanted from the url each time i checked..no problem in getting the data juz that only the graph cannot be refreshed though data in my table quarter1.asp can be displayed successfully...
response.write(selQuarter)
response.write(selYear)
and everthing seems alrite..cos it's retrieving the right data each time i do the dropdownlist and i got wad i wanted from the url each time i checked..no problem in getting the data juz that only the graph cannot be refreshed though data in my table quarter1.asp can be displayed successfully...
i don't quite get whats the use of this:
If Request("quarter1.asp?Mast erID="&Mas terID&"&se lYear="&se lYear&"&re load") Then Response.Write "window.location.reload(); "
is there a variable name 'quarter1.asp?MasterID="&M asterID&"& selYear="& selYear&"& reload'
try commenting this line and see what it does
If Request("quarter1.asp?Mast
is there a variable name 'quarter1.asp?MasterID="&M
try commenting this line and see what it does
ASKER
Oh I was trying to use a variable to refresh the page..anyway..this line can be left out..
opps sorry forgot to comment it out..
opps sorry forgot to comment it out..
can you tell us what you do to solve your problem?
ASKER
Instead of refreshing the page I made it load a new window instead of everytime the selection was made. This saves the risk of the page being unable to load properly. Cos somehow the reloading fucntion has been in vain when i tried countless times.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
dim MasterID, selYear, selQuarter
MasterID = request.QueryString("Maste
selYear = request("selYear")
selQuarter = request("selQuarter")
'response.write(selQuarter
'response.write(selYear)
if selYear = "" then
selYear = Year(date)
end if
currentmth= month(now())
if selMonth = "" then
selMonth = currentmth
end if
Select Case selQuarter
case 001
strDestPage = "quarter1.asp?MasterID="&M
case 002
strDestPage = "quarter2.asp?MasterID="&M
case 003
strDestPage = "quarter3.asp?MasterID="&M
End Select
if strDestPage <> "" then
response.Redirect strDestPage
'Response.Redirect url & "?" & Server.URLEncode(cstr(now)
'Response.Redirect url & "?" & (Int( 555555 * Rnd ) + 1)
end if
%>
This is wad i did so far for choosequarterlist.asp...
Anyone can help fast?