Hi,
I have a project to pull data out of a SQL database into and xml file through a dynamic form where the user has options to select variables, date ranges etc.I want this
data to populate or create an .xml file.
I can build the form and can get the data from the database no problem when I submit the form directly to my data.xml but the problem I have is I have to load the page
below (Chart.html) not data.xml The below code references the data.xml file and produces the results in a graphical chart.
What I am looking for is someone’s input on how they would tackle this I am fluent in ASP and SQL and I can work my way round XML but I haven't used the XML technology
enough to no the best way to tackle this. There is going to be many variation of charts to display so I need to build the xml as defined by the users from the form.
Hope this is clear and just so you know I can reference and actual .xml file or an .asp page that formulates an xml page via my chart.html.
Thanks in advance.
Chart.html
This is the test page I setup to get my data and it does create the required asp/xml file on the fly but not permanently so when I redirect to chart.html above there is
no data to display and no chart appears. Where as if I had a static asp or xml page and load directly the chart.html page the chart is perfect.
data.asp
I have a project to pull data out of a SQL database into and xml file through a dynamic form where the user has options to select variables, date ranges etc.I want this
data to populate or create an .xml file.
I can build the form and can get the data from the database no problem when I submit the form directly to my data.xml but the problem I have is I have to load the page
below (Chart.html) not data.xml The below code references the data.xml file and produces the results in a graphical chart.
What I am looking for is someone’s input on how they would tackle this I am fluent in ASP and SQL and I can work my way round XML but I haven't used the XML technology
enough to no the best way to tackle this. There is going to be many variation of charts to display so I need to build the xml as defined by the users from the form.
Hope this is clear and just so you know I can reference and actual .xml file or an .asp page that formulates an xml page via my chart.html.
Thanks in advance.
Chart.html
Code:
<html>
<head>
<title>My First FusionCharts</title>
</head>
<body bgcolor="#ffffff">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="[URL unfurl="true"]http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"[/URL]
width="900" height="300" id="Column3D" >
<param name="movie" value="../FusionCharts/Doughnut2D.swf" />
<param name="FlashVars" value="&dataURL=Data.asp&chartWidth=900&chartHeight=300">
<param name="quality" value="high" />
<embed src="../FusionCharts/Doughnut2D.swf" flashVars="&dataURL=Data.asp&chartWidth=900&chartHeight=300" quality="high" width="900" height="300"
name="Column3D" type="application/x-shockwave-flash" pluginspage="[URL unfurl="true"]http://www.macromedia.com/go/getflashplayer"[/URL] />
</object>
</body>
</html>
This is the test page I setup to get my data and it does create the required asp/xml file on the fly but not permanently so when I redirect to chart.html above there is
no data to display and no chart appears. Where as if I had a static asp or xml page and load directly the chart.html page the chart is perfect.
data.asp
Code:
<%@ Language=VBScript %>
<!--#include file="includes/connection.asp"-->
<%
user = Request.Form("wce_uid")
sday = Request.Form("sday")
smonth = Request.Form("smonth")
syear = Request.Form("syear")
eday = Request.Form("eday")
emonth = Request.Form("emonth")
eyear = Request.Form("eyear")
startdate = (syear)&"/"&(smonth)&"/"&(sday)
enddate = (eyear)&"/"&(emonth)&"/"&(eday)
qry = "SELECT SUM (wce_products.amount) As total FROM wce_sales INNER JOIN wce_products ON wce_sales.uniqueid = wce_products.saleid WHERE wce_sales.recordmanager = '"&
("53b1rjz1rw06k9l7")&"' AND wce_sales.createtime >= '"&(startdate)&"' AND wce_sales.createtime <= '"&(enddate)&"'"
Set oRs = connStr.Execute(qry)
total = oRs("total")
'response.write(total)
'response.end
response.Write("<chart caption='Monthly Sales Summary per user' xAxisName='Month' yAxisName='Sales' numberPrefix='£'>")
response.Write("<set label='test' value='"&(total)&"' />")
response.Write("</chart>")
%>