467,161 Members | 889 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,161 developers. It's quick & easy.

flash graph not showing

i've put this page together using asp, html, javascript amd flash.

java passes a number of variables over to the flash file but the flash graph does not appear. The error which appears is SWFObject in undefined. The script tag contained <script type="text/javascript"> but after taking the "text/" out the, the pages shows not error but also not graph!!!!

at the end of my tether. PLEASE HELP!!!

code is list below

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Option Explicit%>
<%Response.Buffer = false%>
<!--#include file="../../app_config/cc_config.asp"-->
<!--#include file="../../app_config/version.asp"-->
<!--#include file="../../app_config/db_config.asp" -->
<!--#include file="../../resources/includes/inc_client_brand.asp" -->
<!--#include file="../../resources/includes/functions_sql.asp" -->
<!--#include file="../../resources/includes/functions_datetime.asp" -->


<%' ~~~~~~~~~~~~~~~~~~~~~~~~~~~ SET PAGE NAV AND PERMISSIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Restrict Access to page
Dim iAccessID
iAccessID = 4 ' Equal to the AA_SECURITYID for this page
%>
<!--#include file="../includes/inc_restrictaccess.asp"-->
<%' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %>

<%
' declare variables
Dim rsData, rsResults, rsLevel, ft_ID, clientID

Dim frmCompleted, completedByDisplay
Dim frmPriority, priorityDisplay, chart, javaChart, profile, pro, profileSQL
Dim f_day, f_month, f_year, fromDate, fromDateFormatted
Dim t_day, t_month, t_year, toDate, toDateFormatted
Dim rsSelectedList, reportSelectList, rsProfile
Dim reportSQL, reportJoinSQL, reportOrderSQL
Dim formError
Dim urlQueryVars
Dim option1, option2, option3, option4, option5, option6, option7, option8, option9, option10
Dim n

Dim iRow, rowColor ' alternating row colours
iRow = 1
n = 1


' get search variables
if not isnowt (request.form("clientID")) then
clientID = request.form("clientID")
else
clientID = request.querystring("clid")
end if

if not isnowt (request.form("frmFramework")) then
ft_id = request.form("frmFramework")
else
ft_id = request.querystring("cfid")
end if

if not isnowt (request.form("frmCompleted")) then
frmCompleted = request.form("frmCompleted")
else
frmCompleted = request.querystring("compl")
end if

if not isnowt (request.form("frmPriority")) then
frmPriority = request.form("frmPriority")
else
frmPriority = request.querystring("priority")
end if

if not isnowt (request.form("frmChart")) then
chart = request.form("frmChart")
else
chart = request.querystring("chart")
end if


if not isnowt (request.form("frmJobProfile")) then
profile = request.form("frmJobProfile")
else
profile = request.querystring("profile")
end if


f_day = request.form("f_day")
f_month = request.form("f_month")
f_year = request.form("f_year")
t_day = request.form("t_day")
t_month = request.form("t_month")
t_year = request.form("t_year")

fromDate = request.QueryString("fromD")
toDate = request.QueryString("toD")

if frmPriority = 1 then
priorityDisplay = "Display the 10 lowest performing competencies"
reportSQL = " AND (BUSINESS_COMPS.BC_PRIORITY = 1) "
reportOrderSQL = "ASC"
elseif frmPriority = 2 then
priorityDisplay = "Display the 10 highest performing competencies"
reportSQL = ""
reportOrderSQL = "DESC"
end if

if isnowt(toDate) then
toDate = t_day & "-" & t_month & "-" & t_year
toDateFormatted = dateShortDisplay(toDate)
Else
toDateFormatted = dateShortDisplay(toDate)
If IsDate(toDate) Then
t_day = day(toDate)
t_month = monthname(month(toDate))
t_year = year(toDate)
End If
end if

if isnowt(fromDate) then
fromDate = f_day & "-" & f_month & "-" & f_year
fromDateFormatted = dateShortDisplay(fromDate)
Else
fromDateFormatted = dateShortDisplay(fromDate)
If IsDate(fromDate) Then
f_day = day(fromDate)
f_month = monthname(month(fromDate))
f_year = year(fromDate)
End If
end if

urlQueryVars = "clid=" & clientID & "&cfid=" & ft_id & "&compl=" & frmCompleted & "&toD=" & Server.URLEncode(toDate) & "&fromD=" & Server.URLEncode(fromDate) & "&priority=" & frmPriority & "&chart=" & chart & "&profile=" & profile



If not IsDate(toDate) Then
formError = 1
response.redirect("mis_cs_dp_home.asp?error=1&" & urlQueryVars )
End If

If not IsDate(fromDate) Then
formError = 1
response.redirect("mis_cs_dp_home.asp?error=1&" & urlQueryVars )
End If

if isnowt(clientID) then
response.redirect("mis_cs_dp_home.asp?error=2&" & urlQueryVars )
end if

if isnowt(frmCompleted) then
if not isnowt(request.QueryString("compl")) then
frmCompleted=request.QueryString("compl")
else
response.redirect("mis_cs_dp_home.asp?error=3&" & urlQueryVars )
end if
end if

if isnowt(frmPriority) then
frmPriority=request.QueryString("priority")
end if

Set rsLevel = Server.CreateObject("ADODB.Recordset")
rsLevel.ActiveConnection = connSTRING
rsLevel.Source = "SELECT LEV_NAME FROM LEVELS WHERE LEV_ID=" & SQLNumber(frmCompleted) &" AND LEV_STATUS='v'"
rsLevel.CursorType = 0
rsLevel.CursorLocation = 2
rsLevel.LockType = 1
rsLevel.Open()

If not(rsLevel.BOF and rsLevel.EOF) Then
completedByDisplay = rsLevel("LEV_NAME")
Else
completedByDisplay = ""
End If

rsLevel.Close()
Set rsLevel = Nothing

Set rsProfile = Server.CreateObject("ADODB.Recordset")
rsProfile.ActiveConnection = connSTRING
rsProfile.Source = "SELECT JP_NAME FROM JOB_PROFILES WHERE JP_ID=" & SQLNumber(profile) &" AND JP_STATUS='v'"
rsProfile.CursorType = 0
rsProfile.CursorLocation = 2
rsProfile.LockType = 1
rsProfile.Open()


if not(rsProfile.eof and rsProfile.bof) then
pro = rsProfile("JP_NAME")

profileSQL = "and (JOB_PROFILES.JP_ID ="&SQLNumber(profile)&")"
else
pro = "All Job Profiles"
end if


rsProfile.Close()
Set rsProfile = Nothing

reportJoinSQL = " INNER JOIN JOB_PROFILES ON USER_DNA.UDNA_JP_ID = JOB_PROFILES.JP_ID INNER JOIN LEVELS ON JOB_PROFILES.JP_LEV_ID = LEVELS.LEV_ID "
reportSQL = reportSQL & " AND (JOB_PROFILES.JP_LEV_ID = "&SQLNumber(frmCompleted)&") "


' ADD DATES TO REPORT QUERY
reportSQL = reportSQL & " AND (USER_DNA.UDNA_STARTED>=" & SQLDate(fromDate) & ") AND (USER_DNA.UDNA_STARTED<=" & SQLDate(toDate) & ")"

Set rsData = Server.CreateObject("ADODB.Recordset")
rsData.ActiveConnection = connSTRING
rsData.Source = " SELECT DISTINCT FRAMEWORK_TYPE.FT_NAME, FRAMEWORK_TYPE.FT_ID, CLIENTS.CL_NAME"&_
" FROM USERS INNER JOIN "&_
" CLIENTS ON USERS.U_CL_ID = CLIENTS.CL_ID INNER JOIN "&_
" JOB_PROFILES ON CLIENTS.CL_ID = JOB_PROFILES.JP_CL_ID INNER JOIN "&_
" LEVEL_COMPS ON JOB_PROFILES.JP_LEV_ID = LEVEL_COMPS.LC_LEV_ID INNER JOIN "&_
" BUSINESS_COMPS ON LEVEL_COMPS.LC_BC_ID = BUSINESS_COMPS.BC_ID INNER JOIN "&_
" SCOPES ON BUSINESS_COMPS.BC_SC_ID = SCOPES.SC_ID INNER JOIN "&_
" DEFINITIONS ON SCOPES.SC_DEF_ID = DEFINITIONS.DEF_ID INNER JOIN "&_
" FRAMEWORK_TYPE ON DEFINITIONS.DEF_FT_ID = FRAMEWORK_TYPE.FT_ID "&_
" WHERE (USERS.U_CL_ID = "&SQLNumber(clientID)&")"
rsData.CursorType = 0
rsData.CursorLocation = 2
rsData.LockType = 1
rsData.Open()

ft_ID = rsData("FT_ID")

Set rsResults = Server.CreateObject("ADODB.Recordset")
rsResults.ActiveConnection = connSTRING
rsResults.Source = " SELECT TOP 10 AVG(USER_ANSWERS.UAN_SCORE) AS COMPSCORE, BUSINESS_COMPS.BC_ID, BUSINESS_COMPS.BC_REF, BUSINESS_COMPS.BC_NAME, CLIENT_BENCHMARKS.CBM_SCORE "&_
" FROM USER_ANSWERS INNER JOIN USER_DNA ON USER_ANSWERS.UAN_UDNA_ID = USER_DNA.UDNA_ID INNER JOIN QUESTIONS "&_
" ON USER_ANSWERS.UAN_QU_ID = QUESTIONS.QU_ID INNER JOIN BUSINESS_COMPS ON QUESTIONS.QU_BC_ID = BUSINESS_COMPS.BC_ID "_
&"INNER JOIN CLIENT_BENCHMARKS ON BUSINESS_COMPS.BC_ID = CLIENT_BENCHMARKS.CBM_BC_ID " & reportJoinSQL &_
" WHERE (USER_DNA.UDNA_WORKFLOW = 'f') AND (CLIENT_BENCHMARKS.CBM_CL_ID = "&SQLNumber(clientID)&") "&reportSQL&" "& profileSQL &_
" GROUP BY BUSINESS_COMPS.BC_ID, BUSINESS_COMPS.BC_REF, BUSINESS_COMPS.BC_NAME, CLIENT_BENCHMARKS.CBM_SCORE ORDER BY COMPSCORE "&reportOrderSQL&""
rsResults.CursorType = 0
rsResults.CursorLocation = 2
rsResults.LockType = 1
rsResults.Open()


%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/management.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- ~~~~~~~~~~~~~~~~~~~~~~ DNA Development Centre Platform ~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- All code and content is copyright (c) DeltaNet International Ltd. -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~ www.delta-net.co.uk ~~~~~~~~~~~~~~~~~~~~~~~ -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--#include file="../../resources/includes/mc_metadata.inc"-->
<title><%=cc_org_name%> - <%=cc_app_name%></title>
<link href="../../resources/styles/default_mc.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>

<body>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
START SKIP NAV LINKS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<div class="nopad red_bg"><a accesskey="s" href="#content"><img src="../../media/images/spacer.gif" alt="Skip navigation jump to main content" width="1" height="1" border="0"></a></div>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
START HEADER
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<div class="header_bg"><!--#include file="../../resources/includes/inc_header_mc.asp" --></div>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
START MAIN NAV
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<div class="breadcrumb" align="right"><!-- InstanceBeginEditable name="loggedin" -->Logged in as:&nbsp;<%=session("fullName")%>&nbsp;|&nbsp;<a href="../help/help.asp" class="help">Help</a>&nbsp;|&nbsp;<a href="../authentication/logout.asp" class="help">Logout</a><!-- InstanceEndEditable --></div>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
START CONTENT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->




<table width="100%" border="0" cellpadding="0" summary="Main content layout table, Breadcrumb trail, side navigation and main content">
<tr>
<td class="bg_sidenav_header"><img src="../media/images/spacer.gif" alt=" " width="160" height="15"></td>
<td width="100%" valign="middle">
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="Breadcrumb navigation trail">
<tr>
<td valign="top"><img src="../media/images/interface/bllt_breadcrumb.gif" alt=" " width="28" height="12"></td>

<td width="100%" valign="top" class="breadcrumb"><a name="breadcrumb"></a><!-- InstanceBeginEditable name="breadcrumb" --><a href="../home/home.asp" class="breadcrumb">Home</a>&nbsp;&gt;&nbsp;<a href="../home/mis_home.asp" class="breadcrumb">MIS
reports</a>&nbsp;&gt; <a href="mis_cs_home.asp" class="breadcrumb">Client
specific</a> &gt; <a href="mis_cs_bs_home.asp?<%=urlQueryVars%>" class="breadcrumb">Benchmark
standards report</a> &gt; Summary &gt;<!-- InstanceEndEditable --></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" class="bg_greypale"><img src="../../media/images/spacer.gif" alt=" " width="1" height="1"></td>
</tr>
<tr>
<td valign="top" class="bg_sidenav">
<a name="mainnav"></a>
<!--#include file="../includes/inc_sidenav.asp" -->
<!-- InstanceBeginEditable name="sidenav" -->

<!-- InstanceEndEditable --></td>
<td valign="top" class="maincontent"><a name="content"></a> <!-- InstanceBeginEditable name="maincontent" -->
<h1><img src="../media/images/interface/bllt_title.gif" alt=" " width="20" height="14">Client specific - Benchmark standards report</h1>
<p>Benchmark standards report.</p>
<table width="100%" border="1" cellspacing="0" cellpadding="3" summary="Report basis" class="tbl_border1">
<tr>
<th colspan="2" nowrap class="th_head"><div align="left">Report basis</div></th>
</tr>
<tr valign="top">
<td nowrap class="td_row2">Client name:&nbsp;</td>
<td width="100%" class="td_row2"><%=rsData("CL_NAME")%>&nbsp;</td>
</tr>
<tr valign="top">
<td nowrap class="td_row1">Assessment period from:&nbsp;</td>
<td width="100%" class="td_row1"><%=fromDateFormatted%>&nbsp;</td>
</tr>
<tr valign="top">
<td nowrap class="td_row2">Assessment period to:&nbsp;</td>
<td class="td_row2"><%=toDateFormatted%>&nbsp;</td>
</tr>
<tr valign="top">
<td nowrap class="td_row1">Completed by Job Level:&nbsp;</td>
<td class="td_row1"><%=completedByDisplay%>&nbsp;</td>
</tr>
<tr valign="top">
<td nowrap class="td_row2">Completed by Job Profile:&nbsp;</td>
<td class="td_row2"><%=pro%>&nbsp;</td>
</tr>
<tr valign="top">
<td nowrap class="td_row1">Performance:&nbsp;</td>
<td class="td_row1"><%=priorityDisplay%>&nbsp;</td>
</tr>
</table>
<img src="../media/images/spacer.gif" alt=" " width="1" height="20">
<table width="100%" border="1" cellspacing="0" cellpadding="3" class="tbl_border1">
<tr>
<th nowrap class="th_head">BC Ref:</th>
<th width="100%" nowrap class="th_head"><div align="left">Business competency
name</div></th>
<th nowrap class="th_head">Benchmark scores</th>
<th nowrap class="th_head">Average scores</th>
</tr>
<%
if rsResults.EOF and rsResults.BOF then
%>
<tr>
<td colspan="4" class="td_row1"><span class="redtext">There are no records for this selection.</span></td>
</tr>
<%
end if
%>
<%do while not rsResults.EOF
' alternating row colour code
if iRow = 1 then
rowColor = "td_row1"
iRow = 2
elseif iRow = 2 then
rowColor = "td_row2"
iRow = 1
end if
%>
<tr valign="top">
<td class="<%=rowColor%>"><%=rsResults("BC_REF")%>&nbs p;</td>
<td class="<%=rowColor%>"><a href="mis_cs_bs_pie.asp?bcid=<%=rsResults("BC_ID") %>&<%=urlQueryVars%>"><%=rsResults("BC_NAME")%></a>&nbsp;</td>
<td class="<%=rowColor%>"><%=rsResults("CBM_SCORE")%>% &nbsp;</td>
<td class="<%=rowColor%>"><%=rsResults("COMPSCORE")%>% &nbsp;</td>
</tr>
<%
' assign vars for flash movie
If n= 1 then
option1 = rsResults("BC_NAME") & "[,]" & rsResults("CBM_SCORE") & "[,]" & rsResults("COMPSCORE")
ElseIf n = 2 Then
option2 = rsResults("BC_NAME") & "[,]" & rsResults("CBM_SCORE") & "[,]" & rsResults("COMPSCORE")
ElseIf n = 3 Then
option3 = rsResults("BC_NAME") & "[,]" & rsResults("CBM_SCORE") & "[,]" & rsResults("COMPSCORE")
ElseIf n = 4 Then
option4 = rsResults("BC_NAME") & "[,]" & rsResults("CBM_SCORE") & "[,]" & rsResults("COMPSCORE")
ElseIf n = 5 Then
option5 = rsResults("BC_NAME") & "[,]" & rsResults("CBM_SCORE") & "[,]" & rsResults("COMPSCORE")
ElseIf n = 6 Then
option6 = rsResults("BC_NAME") & "[,]" & rsResults("CBM_SCORE") & "[,]" & rsResults("COMPSCORE")
ElseIf n = 7 Then
option7 = rsResults("BC_NAME") & "[,]" & rsResults("CBM_SCORE") & "[,]" & rsResults("COMPSCORE")
ElseIf n = 8 Then
option8 = rsResults("BC_NAME") & "[,]" & rsResults("CBM_SCORE") & "[,]" & rsResults("COMPSCORE")
ElseIf n = 9 Then
option9 = rsResults("BC_NAME") & "[,]" & rsResults("CBM_SCORE") & "[,]" & rsResults("COMPSCORE")
ElseIf n = 10 Then
option10 = rsResults("BC_NAME") & "[,]" & rsResults("CBM_SCORE") & "[,]" & rsResults("COMPSCORE")
End If

n = n + 1
rsResults.MoveNext
loop
%>
</table>
<img src="../media/images/spacer.gif" alt=" " width="1" height="20">
<%

if not rsResults.EOF and rsResults.BOF then
else
n = 1
rsResults.MoveFirst
%>
<table border="0">
<tr>
<td><img src="../../media/spacer.gif" alt=" " width="1" height="25">
<div id="flashcontent">
<strong>You may need to upgrade your Flash Player</strong><br>
<a target="_blank" href="http://www.adobe.com/">Download the latest flash player here</a>
</div>
</td>
<td width="75%">
<table border="0" class="tbl_border1">
<tr>
<th nowrap class="th_head">Key</th>
<th nowrap class="th_head"><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;Business competency name</div></th>
</tr>
<%
do while not rsResults.EOF
%>
<tr>
<td width="20" bgcolor="#000000"><img src="../../media/spacer.gif" alt=" " width="1" height="1"><div align="center" class="whitetext"><%=n%></div><img src="../../media/spacer.gif" alt=" " width="1" height="1"></td>
<td>&nbsp;&nbsp;&nbsp;<%=rsResults("BC_NAME")%></td>
</tr>
<%
n = n + 1
rsResults.MoveNext
loop

if chart = "1" then
javaChart = "multiple_bar_chart.swf"
else
javaChart = "multiple_spider_chart.swf"
end if

%>
<script type="javascript">
// <![CDATA[

var so = new SWFObject("../../media/flash/<%=javaChart%>", "movie", "600", "600", "6", "#FFFFFF");
so.addVariable("screenMode", 2);
so.addVariable("noTick", <%=n%>);
so.addVariable("option1", "<%=replaceCRLF(option1)%>");
so.addVariable("option2", "<%=replaceCRLF(option2)%>");
so.addVariable("option3", "<%=replaceCRLF(option3)%>");
so.addVariable("option4", "<%=replaceCRLF(option4)%>");
so.addVariable("option5", "<%=replaceCRLF(option5)%>");
so.addVariable("option6", "<%=replaceCRLF(option6)%>");
so.addVariable("option7", "<%=replaceCRLF(option7)%>");
so.addVariable("option8", "<%=replaceCRLF(option8)%>");
so.addVariable("option9", "<%=replaceCRLF(option9)%>");
so.addVariable("option10", "<%=replaceCRLF(option10)%>");
so.write("flashcontent");

// ]]>//
</script>
</table>
</td>
</tr>
</table>

<%
end if
%>




<!-- InstanceEndEditable --></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="Footer content layout table">
<tr>
<td colspan="2" class="bg_white"><img src="../media/images/spacer.gif" alt=" " width="1" height="1"></td>
</tr>
<tr>
<td colspan="2" class="bg_greypale"><img src="../media/images/spacer.gif" alt=" " width="1" height="1"></td>
</tr>
<tr>
<td class="footer"><%=cc_version%></td>
<td class="footer"><div align="right">&copy; DeltaNet International Ltd</div>
</td>
</tr>
<tr>
<td colspan="2" class="bg_greypale"><img src="../media/images/spacer.gif" alt=" " width="1" height="1"></td>
</tr>
</table>
<p>&nbsp;</p>
</body>
<!-- InstanceEnd --></html>
Mar 12 '08 #1
  • viewed: 2001
Share:
1 Reply
SORTED!!!! :o)
missed out <script type="text/javascript" src="../../resources/scripts/swfobject.js"></script> from the headed. silly me
Mar 12 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by P. Ter Horst | last post: by
reply views Thread by cprestino@yahoo.com | last post: by
2 posts views Thread by savas_karaduman@yahoo.com | last post: by
8 posts views Thread by Adrian | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.