Sign in to follow this  
elias75

Problem loading XML data to line chart from ASP

Recommended Posts

Hello,

I have created a line chart (Line.SWF) using a dynamic file named "TimeSeriesData.ASP" to provide the XML data for the chart (from an MS Access database)

Here is the code for how I invoke the line chart:

 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="700" height="400" id="Line" >

<param name="movie" value="../FusionCharts/Line.swf" />

<param name="FlashVars" value="dataURL=<%= encodeDataURL("TimeSeriesChartData.asp?chartType=" & chartIndex & "&dataPoint=" & request("dataPoint") & "&dateRange=" & dateRange, true) %>&debugMode=1" />

<param name="quality" value="high" />

<embed src="../FusionCharts/Line.swf" width="700" height="400" name="Line" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

  </object>

 

The code works fine in the base case but throws an "Error loading data file" when I put the follow SQL code in

sql2 = "SELECT lead_id, lead_quantity_required, lead_quote_price, lead_how_heard FROM sales_leads "& _

 "WHERE lead_status <> 'CLOSED VOID' and create_date >= #" & theMonth & "/1/" & theYear & "# " & _

 "AND create_date < #" & nextMonth & "/1/" & nextYear & "# " & _

 " AND " & request("chartType") & " = '" & request("dataPoint") & "'"

 

It's strange though, because when I run the "TimeSeriesData.asp" file by cutting and pasting the URL  to a browser, it properly loads the XML (well formed and everything)

I also, turned on debug mode and saw the following ERROR:

ERROR: An error occurred while loading data. Please check your dataURL, by clicking on the "dataURL invoked" link above, to see if it's returing valid XML data. Common causes for error are:

No URL Encoding provided for querystrings in dataURL. If your dataURL contains querystrings as parameters, you'll need to URL Encode the same. e.g., Data.asp?id=101&subId=242 should be Data%2Easp%3Fid%3D101%26subId%3D242

Different sub-domain of chart .swf and dataURL. Both need to be same owing to sandbox security.

Network error

 

Now I am using URL Encode and I am using the same sub-domain so I have to believe it's a network error.  I suspect it's some kind of time-out, does that sound right? That's the only thing that comes to mind that is different between when i use SQL and when I make it static (output XML is exactly the same)

Any help would be appreciated.

Share this post


Link to post
Share on other sites

Hi,

Could you please use Server.URLEncode and try again?

value="dataURL=<%= Server.URLEncode("TimeSeriesChartData.asp?chartType=" & chartIndex & "&dataPoint=" & request("dataPoint") & "&dateRange=" & dateRange) %>&debugMode=1"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this