Questions? Email us:
sales@haneng.com

 

Developers Forum



| List all messages | Search Developers forum | Post new forum message |



ASP Error
Vicki | Posted 10:40am 21. August 2001 Server Time |

I'm hoping that you can help me!

I hope that you havn't already recieved this, I tried submitting but nothing seemed to happen. I'm having a bad browser day! Apologies if you have.

I have been looking into using Haneng Charts connecting to an Access 2000 db and have implemented the following code..

<APPLET CODE="HanengCharts.class" ARCHIVE="HanengCharts2.jar" WIDTH=450 HEIGHT=250>
<PARAM NAME="ChartType" VALUE="multi3dbar">
<PARAM NAME="LicenseKey" VALUE="CXRRZX*&zaO[/A">
<%
dim sql, rsgrossprod
set rsgrossprod = server.createobject("adodb.recordset")
sql ="SELECT year, sum(production_liquids) as sumliquids,"
sql = sql &" sum(production_gas) as sumgas,"
sql = sql &" sum(capital_costs) as sumcap, sum(operating_costs) as sumop"
sql = sql &" FROM gross_prod"
sql = sql &" WHERE transparency = 11"
sql = sql &" GROUP BY Year"
'response.write sql
rsgrossprod.open sql,conn

dim icount
icount = 1

WHILE NOT rsgrossprod.EOF
%>
<PARAM NAME="Year<%=icount%>" VALUE="<%=rsgrossprod("year")%>>
<PARAM NAME="<%=icount&"a"%>" VALUE="<%=trim(rsgrossprod("sumliquids"))+1%>">
<PARAM NAME="<%=icount&"b"%>" VALUE="<%=trim(rsgrossprod("sumgas")/5.8)+1%>">
<%rsgrossprod.MoveNext
  icount = icount+1
WEND%>
<PARAM NAME="DataSet_a" VALUE="Sum Liquids">
<PARAM NAME="DataSet_b" VALUE="Sum Gas">
</APPLET>

<%rsgrossprod.Close
Set rsgrossprod = nothing
Conn.Close
Set Conn = nothing
%>

When I load the page in the browser, I get the following error message...

"An error occured, you must supply at least one parameter"

When I view the source, it appears to be OK, but I'll happily stand corrected!

<!-- HanengCharts Code Starts Here -->
<APPLET CODE="HanengCharts.class" ARCHIVE="HanengCharts2.jar" WIDTH=450 HEIGHT=250>
<PARAM NAME="ChartType" VALUE="multi3dbar">
<PARAM NAME="LicenseKey" VALUE="CXRRZX*&zaO[/A">

<PARAM NAME="Year1" VALUE="1994>
<PARAM NAME="1a" VALUE="1">
<PARAM NAME="1b" VALUE="1">

<PARAM NAME="Year2" VALUE="1995>
<PARAM NAME="2a" VALUE="1">
<PARAM NAME="2b" VALUE="1">

<PARAM NAME="Year3" VALUE="1996>
<PARAM NAME="3a" VALUE="1">
<PARAM NAME="3b" VALUE="1">

<PARAM NAME="Year4" VALUE="1997>
<PARAM NAME="4a" VALUE="1">
<PARAM NAME="4b" VALUE="1">

<PARAM NAME="Year5" VALUE="1998>
<PARAM NAME="5a" VALUE="23.7999992370605">
<PARAM NAME="5b" VALUE="1">

<PARAM NAME="Year6" VALUE="1999>
<PARAM NAME="6a" VALUE="103.900001525879">
<PARAM NAME="6b" VALUE="1">

<PARAM NAME="Year7" VALUE="2000>
<PARAM NAME="7a" VALUE="127.900001525879">
<PARAM NAME="7b" VALUE="1">

<PARAM NAME="Year8" VALUE="2001>
<PARAM NAME="8a" VALUE="125.5">
<PARAM NAME="8b" VALUE="1">

<PARAM NAME="Year9" VALUE="2002>
<PARAM NAME="9a" VALUE="124.599998474121">
<PARAM NAME="9b" VALUE="6.53448249553812">

<PARAM NAME="Year10" VALUE="2003>
<PARAM NAME="10a" VALUE="117">
<PARAM NAME="10b" VALUE="6.3448275862069">

<PARAM NAME="Year11" VALUE="2004>
<PARAM NAME="11a" VALUE="100.5">
<PARAM NAME="11b" VALUE="6.70689628864157">

<PARAM NAME="DataSet_a" VALUE="Sum Liquids">
<PARAM NAME="DataSet_b" VALUE="Sum Gas">
</APPLET>

Am I supplying too much information? I have tried to cover my back for null values, but this doesn't appear to be working either. Your help appreciated.

I have had to cut down the number of entries showing in source as I had over 4000 characters..sorry.

Thanks
Vicki
HanengCharts Support | Posted 11:49am 21. August 2001 Server Time |

Hi Vicki,
The problem is that you don't use the proper way to insert data into HanengCharts. This is how you have to do it:

icount = 1
WHILE NOT rsgrossprod.EOF
  %>
  <PARAM NAME="Text_<%=icount%>" VALUE="<%=rsgrossprod("year")%>>
  <PARAM NAME="Value_a_<%=icount%>" VALUE="<%=trim(rsgrossprod("sumliquids"))+1%>">
  <PARAM NAME="Value_b_<%=icount%>" VALUE="<%=trim(rsgrossprod("sumgas")/5.8)+1%>">
  <%
  rsgrossprod.MoveNext
  icount = icount+1
WEND
%>

For details on allowed PARAM names see the documentation (Click on the support link on the left menu)

I hope this fixed your problem, if not just let me know!

-HanengCharts Support
Vicki | Posted 7:13am 22. August 2001 Server Time |

Thank you, it's all working now.  If only people would read the guidelines! Sorry.

Another seperate question for type of charts available. I was wondering if you were working on or had any plans for developing a clustered bar chart?  

Thanks again
Vicki
HanengCharts Support | Posted 12:34am 22. August 2001 Server Time |

Hi Vicki,
I am glad it worked.

We are considering it, but I am not sure when we will add it.

-HanengCharts Support
Want to reply?
We are sorry, but this forum is closed. If you have any support questions please email us at support@haneng.com