<%@ 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") 'Make a record set that lists the document types Set conn3 = Server.CreateObject("ADODB.connection") conn3.Open "DSN=MRCDC" vsql3="select doc_Type from qry_Count_byLocation_byType group by doc_Type" 'response.write vsql3 Set oRs3=conn3.execute(vsql3) 'Make a record set that lists the locations Set conn2 = Server.CreateObject("ADODB.connection") conn2.Open "DSN=MRCDC" vsql2="select spatial_general_abbrev, spatial_general_order from qry_Count_byLocation_byType GROUP BY spatial_general_abbrev, spatial_general_order ORDER BY spatial_general_order" 'response.write vsql2 Set oRs2=conn2.execute(vsql2) 'Make a record set for all the data Set conn1 = Server.CreateObject("ADODB.connection") conn1.Open "DSN=MRCDC" vsql1="select * from qry_Count_byLocation_byType" 'response.write vsql1 Set oRs1=conn1.execute(vsql1) 'We finally have the queried recordset in oRs 'So now we build the XML Content 'Create the subCaption mySubCaption = "Document Counts by Location" Dim strXML strXML = "" strXML = strXML & "" while NOT oRs2.eof strXML = strXML & "" oRs2.MoveNext Wend strXML = strXML & "" 'Loop through each document types myInt = 0 While NOT ors3.eof myColor = colors(myInt) strXML = strXML & "" 'Now connect to the main dataset and write out the data values 'strFilter = "doc_Type = '" & ors3.fields("doc_Type") & "'" 'response.write strFilter 'ors1.Filter = strFilter ors2.MoveFirst while NOT ors2.eof strFilter = "doc_Type = '" & ors3.fields("doc_Type") & "' AND spatial_general_abbrev = '" & ors2.fields("spatial_general_abbrev") & "'" ors1.Filter = strFilter If NOT ors1.eof Then strXML = strXML & "" 'ors1.moveNext Else strXML = strXML & "" End if ors2.moveNext Wend strXML = strXML & "" myInt = myInt + 1 ors3.MoveNext Wend strXML = strXML & "" Set Conn2 = nothing Set oRs = nothing 'We finally relay the XML Content Response.Write(strXML) %>