<%@ Language=VBScript %> <% 'In this page, we just relay the XML Content to FusionCharts 'We ask the server not to cache the page Response.Expires = 0 'We tell the server that we are going to send XML Content Response.ContentType = "text/xml" 'Set up an array of colors for each series Colors = Array("33FF66", "FF6600", "3399FF", "009966", "CC3399", "FFCC33", "6699CC", "CC3366", "993366", "0033FF", "0099ff", "FFCC00", "FF0000", "9900FF", "993333", "66FFCC", "CC99FF", "CCCC00", "33CCCC", "336699", "CC6666", "663399", "00CC33", "999999", "FF33FF", "FF9966", "9966FF") 'Get the report year 'strRepYr = session("RepYr") 'strPermitNumber = session("permitNumber") 'We now request the data 'We now query the Database Set conn2 = Server.CreateObject("ADODB.connection") conn2.Open "DSN=MRCDC" vsql="select * from qry_Count_byType" 'response.write vsql Set oRs=conn2.execute(vsql) 'We finally have the queried recordset in oRs 'So now we build the XML Content 'Calculate how many vertical lines 'numDivs = numVDivs() 'Create the subCaption mySubCaption = "Document Counts by Type" Dim strXML strXML = "" myInt = 0 while NOT oRs.eof myColor = colors(myInt + 1) strXML = strXML & "" myInt = myInt + 1 oRs.MoveNext Wend 'Add the x axis categories. For this graph there are 12 months. 'strXML = strXML & "" 'monthArray = Array("11", "12", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10") 'for m = 0 to 11 STEP 1 ' strXML = strXML & "" 'Next 'strXML = strXML & "" 'myInt = 0 'dim cumArray(11) 'If Not oRs.Eof Then ' myColor = colors(myInt + 1) ' strXML = strXML & "" ' for mo = 1 to 12 STEP 1 ' 'strXML = strXML & "" ' strFilter = "Date = '" & mo & "/" & strRepYr & "'" ' 'response.write strFilter ' oRs.Filter = strFilter ' If not oRs.Eof Then ' strXML = strXML & "" ' cumArray(myInt) = ors("mo_inches") ' Else ' strXML = strXML & "" ' cumArray(myInt) = 0 ' End if ' oRs.Filter = "" ' myInt = myInt + 1 ' Next ' strXML = strXML & "" ' End if ' 'Now add the cummulative line ' strXML = strXML & "" ' cum = 0 ' for i = 0 to 11 ' cum = cum + cumArray(i) ' strXML = strXML & "" ' Next ' strXML = strXML & "" strXML = strXML & "" Set Conn2 = nothing Set oRs = nothing 'We finally relay the XML Content Response.Write(strXML) %> <% function numVDivs() '-- Create object and open database Set DataConnection3 = Server.CreateObject("ADODB.Connection") DataConnection3.Open "DSN=DelMonte" Set cmdDC3 = Server.CreateObject("ADODB.Command") cmdDC3.ActiveConnection = DataConnection3 '-- default SQL 'response.write request.form("txt_ws_id") SQL3 = "select * from qryWWFlow WHERE Flow >= 0" cmdDC3.CommandText = SQL3 Set RecordSet3 = Server.CreateObject("ADODB.Recordset") RecordSet3.Open cmdDC3, , 0, 2 'strFilter1 = "Year=2001" strRepYr = session("RepYr") strFilter1 = "Year="&strRepYr RecordSet3.Filter = strFilter1 'Calculate how many vertical lines myMax = 0 While not recordset3.eof if RecordSet3("Day_of_Pack") > myMax Then myMax = RecordSet3("Day_of_Pack") end if 'response.write mymax RecordSet3.MoveNext Wend numDivs = 7 '(myMax/10) numVDivs = numDivs End Function %>