trovato ,un pò lungo ma funge
codice:
dim tot1
tot1 = 0
dim tot2
tot2 = 0
dim tot3
tot3 = 0
dim tot4
tot4 = 0
CNN=Application("CNN")
set conn=Server.CreateObject("ADODB.Connection")
conn.open CNN
set rs=server.createobject("ADODB.recordset")
' select domanda 1(d1)
qry1="SELECT DISTINCT (d1) AS Espr1, Count(*) AS Espr2 FROM dati GROUP BY dati.d1"
rs.Open qry1,conn
if rs.eof then
response.write ("no dati")
else
'conn.execute(qry1)
while not rs.EOF
'response.write espr1
if rs.fields("espr1") = "sono assolutamente d accordo" then
tot1 = tot1 + rs.fields("espr2")
end if
if rs.fields("espr1") = "sono abbastanza d accordo" then
tot2 = tot2 + rs.fields("espr2")
end if
if rs.fields("espr1") = "non sono del tutto d accordo" then
tot3 = tot3 + rs.fields("espr2")
end if
if rs.fields("espr1") = "non sono affatto d accordo" then
tot4 = tot4 + rs.fields("espr2")
end if
'response.write "
"& rs.fields("espr1") & ""
'response.write "
"& rs.fields("espr2") & ""
rs.MoveNext
wend
end if
rs.close
...ripeti per tutte le 32 domande...
<font color="#0000FF" face="Verdana, Arial, Helvetica, sans-serif">Totali per risposta </font>
<%
'scrittura dei dati
response.write "sono assolutamente d accordo : "& tot1 & "
"
response.write "sono abbastanza d accordo : "& tot2 & "
"
response.write "non sono del tutto d accordo : "& tot3 & "
"
response.write "non sono affatto d accordo : "& tot4 & "
"
set rs=nothing
conn.close
set conn=nothing
%>
<%
Dim Valori1
Dim Valori2
Dim Valori3
Dim Valori4
Dim Categorie(4)
Set cs = Server.CreateObject("OWC10.ChartSpace")
Set chConstants = cs.Constants
Set chart = cs.charts.add
'chart.type = chConstants.chChartTypeRadarLineFilled
chart.type = 47
set serie1 = chart.seriesCollection.add
set serie2 = chart.seriesCollection.add
set serie3 = chart.seriesCollection.add
set serie4 = chart.seriesCollection.add
categorie(1) = "sono assolutamente d accordo"
categorie(2) = "sono abbastanza d accordo"
categorie(3) = "non sono del tutto d accordo"
categorie(4) = "non sono affatto d accordo"
valori1 = tot1
valori2 = tot2
valori3 = tot3
valori4 = tot4
serie1.SetData chConstants.chDimCategories, chConstants.chDataLiteral, categorie(1)
serie1.SetData chConstants.chDimValues, chConstants.chDataLiteral, valori1
serie2.SetData chConstants.chDimCategories, chConstants.chDataLiteral, categorie(2)
serie2.SetData chConstants.chDimValues, chConstants.chDataLiteral, valori2
serie3.SetData chConstants.chDimCategories, chConstants.chDataLiteral, categorie(3)
serie3.SetData chConstants.chDimValues, chConstants.chDataLiteral, valori3
serie4.SetData chConstants.chDimCategories, chConstants.chDataLiteral, categorie(4)
serie4.SetData chConstants.chDimValues, chConstants.chDataLiteral, valori4
cs.ExportPicture server.MapPath("images/prova1.gif"), "GIF", 400, 400
Set cs = Nothing
%>
[img]images/prova1.gif[/img]
e alla fine ti produci anche il grafico