Jump to content


Microsoft JScript runtime error: 'FusionCharts' is undefined


  • Please log in to reply
1 reply to this topic

#1 toddbailey

toddbailey

    Forum Newbie

  • Members
  • 7 posts

Posted 27 December 2008 - 12:16 PM

Hello, I am getting this error when trying to run the basicDBexample demo code.

The code segment that I susbect is failing is in the aspx file

<%=GetFactorySummaryChartHtml()%>

I changed the folderstructure somewhat to match my production environment

the root project is c:vs2005fcTest

in c:vs2005fcTestbin fusioncharts.dll  and is registered

I created a sub folder c:vs2005fcTestFusionCharts that has this structure

c:vs2005fcTestFusionChartsJSClass

c:vs2005fcTestFusionChartsswf

and all the expected files are there.

I'm sure it's an installation issue I overlooked but what is the question.

here is the vb code I'm using

Imports InfoSoftGlobal

Imports System.Text

Imports System.Diagnostics

Imports System.Data

Imports System.Data.Sqlclient

Partial Class DBExample_BasicDBExample

Inherits System.Web.UI.Page

Dim dbtestmode As String = ""

Public Function GetFactorySummaryChartHtml() As String

Dim xmlData As New StringBuilder()

xmlData.Append("<chart caption='Factory Output report' subCaption='By Quantity' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Units'>")

Dim myCMD As SqlCommand

Dim dr As SqlDataReader

Dim dbConnection As New SqlConnection

Dim admconnstr As String = dbtestmode & "AdminDataConnectionString"

'create recordset to get details for the factories

Dim sqlstr As String = "select a.FactoryId, a.FactoryName, sum(b.Quantity) as TotQ from factory.dbo.Factory_Master a, factory.dbo.Factory_Output b where a.FactoryId=b.FactoryID group by a.FactoryId, a.FactoryName"

Try

dbConnection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings(admconnstr).ConnectionString

myCMD = New SqlCommand(sqlstr, dbConnection)

dbConnection.Open()

dr = myCMD.ExecuteReader()

Do While dr.Read()

xmlData.Append("<set label='" & dr.GetValue(1).ToString() & "' value='" & dr.GetValue(2).ToString() & "' />")

Loop

'Close chart element

xmlData.Append("</chart>")

Catch e As SqlException

Dim errorMessages As String = ""

Dim ii As Integer

For ii = 0 To e.Errors.Count - 1

errorMessages += "Location: " & Session("modulename") & System.Reflection.MethodBase.GetCurrentMethod().Name & ControlChars.Cr _

& "Index #" & ii.ToString() & ControlChars.NewLine _

& "Message: " & e.Errors(ii).Message & ControlChars.NewLine _

& "LineNumber: " & e.Errors(ii).LineNumber & ControlChars.NewLine _

& "Source: " & e.Errors(ii).Source & ControlChars.NewLine _

& "Procedure: " & e.Errors(ii).Procedure & ControlChars.NewLine

Next ii

Session("ErrorText") = errorMessages

Response.Redirect("ApplicationEvent.aspx")

End Try

Debug.Print(xmlData.ToString())

'Create the chart - Pie 3D Chart with data from xmlData

Return FusionCharts.RenderChart("~/FusionCharts/swf/Pie3D.swf", "", xmlData.ToString(), "FactorySum", "600", "300", False, False)

End Function

 

 

 

and the aspx code

 

 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="BasicDBExample.aspx.vb"

Inherits="DBExample_BasicDBExample" %>

<html>

<head>

<title>FusionCharts - Database Example </title>

<script language="Javascript" src="../FusionCharts/JSClass/FusionCharts.js"></script>

<style type="text/css">

<!--

body {

font-family: Arial, Helvetica, sans-serif;

font-size: 12px;

}

.text{

font-family: Arial, Helvetica, sans-serif;

font-size: 12px;

}

-->

</style>

</head>

<body>

<form id='form1' name='form1' method='post' runat="server">

<center>

<h2>

FusionCharts Database Example (Using dataXML method)</h2>

<h4>

Click on any pie slice to see detailed data.</h4>

<p class='text'>

Or, right click on any pie to enable slicing or rotation mode.

<%=GetFactorySummaryChartHtml()%>

</p>

<br>

<br>

<h5>

<a href='../default.aspx'> Back to list of examples</a></h5>

<a href='../NoChart.html' target="_blank">Unable to see the chart above?</a>

</center>

</form>

</body>

</html>



#2 Arindam

Arindam

    Supreme Being

  • Members
  • PipPipPipPipPipPipPipPip
  • 730 posts

Posted 28 December 2008 - 11:49 PM

Hi,

According to your folder structure 

c:vs2005fcTestFusionCharts

if you will kept BasicDBExample.aspx.vb and BasicDBExample.aspx with in c:vs2005fcTestFusionCharts then FusionCharts.js and FusionCharts swf file path will be like this. Please follow it.

FusionCharts.js path with in BasicDBExample.aspx file
<script language="Javascript" type="text/javascript" src="JSClass/FusionCharts.js"></script>

SWF path with in BasicDBExample.aspx.vb file
Return FusionCharts.RenderChart("swf/Pie3D.swf", "", xmlData.ToString(), "FactorySum", "600", "300", False, False)

Thanks,

Arindam