






























Questions? Email us:
sales@haneng.com
|
|
Developers Forum



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



ASP/DATABASE
Jim Glodosky | Posted 11:15am 7. August 2001 Server Time |
Hi, I am trying to get any of the charts to dynamically update from a database that is actively updated with lake data from lake monitoring volunteers throughout the state. Our database has multiple fields such as Dissolved Oxygen, sample date, sample depth, etc. I used this and it keeps telling me to provide more labels.
<PARAM NAME="fill" VALUE="false"> <% SQL_query = "SELECT * FROM " & tblCounty & " WHERE Organization = '" & strOrganization & "'" Set objRS = objConn.Execute(SQL_query) WHILE NOT objRS.EOF %> <PARAM NAME="value_1" VALUE="<%=objRS("SecchiDepth")%>"> <% objRS.MoveNext WEND objRS.Close Set objRS = nothing
' Then we get all the text labels from the database ' and generate the HTML parameters that the ' applet will use to make the applet
SQL_query = "SELECT * FROM " & tblCounty & " WHERE Organization = '" & strOrganization & "'" Set objRS = objConn.Execute(SQL_query) WHILE NOT objRS.EOF %> <PARAM NAME="text_1" VALUE="<%=objRS("SampleDate")%>"> <% objRS.MoveNext WEND objRS.Close Set objRS = nothing %> </APPLET> </CENTER> <% objConn.Close Set objConn = Nothing %>
I have been using other combinations and techniques to no avail and really need to get this to work for the Wisconsin DNR. Could you please try to explain what I am doing wrong here. I will also probably have to use the multiple line chart for this.
thanks much,
Jim Glodosky
|
HanengCharts Support | Posted 11:24am 7. August 2001 Server Time |
Hi Jim, In the script you have posted you might notice that all the parameters generated will have the name value_1 or name_1. HanengCharts need different names for each value and text to be able to read it. So just add a little counter and increase it by one for each parameter. See the script below:
i = 1 WHILE NOT objRS.EOF %> <PARAM NAME="value_<%=i%>" VALUE="<%=objRS("SecchiDepth")%>"> <% objRS.MoveNext i = i + 1 WEND
And you need to do the same for the text labels.
Hope this solved your problem!
-HanengCharts Support
Jim Glodosky | Posted 11:48am 7. August 2001 Server Time |
Super!!!!! Thanks big time, I had a feeling it was something like that but didn't know exactly how to go about doing it. Would you mind taking a gander at this:
http://www.uwsp.edu/cnr/cnradmin_s/uwexlakes/lakedata/dataline.asp
The dates are all conglomerated. Is this something the upgrade would take care of?
Srinivas Duggi | Posted 10:37am 10. August 2001 Server Time |
Is there any way to hide the values(labels) on X-axis, because I want to display more than 200 values(labels) on the X-axis. Thanks
HanengCharts Support | Posted 3:40pm 11. August 2001 Server Time |
Hi, Yes, just do not supply a text PARAM value for the value PARAM values and it will not show a label on the x-axis.
-HanengCharts Support
HanengCharts Support | Posted 3:43pm 11. August 2001 Server Time |
Hi Jim, Just increase the width of the chart or decrease the font size.
-HanengCharts Support
Pete | Posted 8:04am 13. August 2001 Server Time |
Hi, I am looking for a charting solution for our intranet to show scrap, sales, product data.
Does this chart work with recordsets??
thanks..
Pete
HanengCharts Support | Posted 8:08am 13. August 2001 Server Time |
Hi Pete, Yes it works with record sets. Just use ASP to output the data to HTML and HanengCharts will be able to read it.
See the developer section (click on Developers on the menu) to see some sample ASP scripts to get you started.
-HanengCharts Support
Pete | Posted 8:24am 13. August 2001 Server Time |
Excellent.. You dont happen to have a Macromedia Ultradev Solution in the works for this do you?
Pete | Posted 12:02am 13. August 2001 Server Time |
Here's what our data looks like.
REASON QTY PL
reason1 10 1050 reason2 15 1050 reason3 12 1050 reason4 11 1050 reason5 17 1050 reason1 10 1100 reason2 15 1100
Now I want to create a char just for Pl = 1050 How do we put the data in the database to get the result. Thanks a lot.
HanengCharts Support | Posted 12:30am 13. August 2001 Server Time |
Hi Pete, I will look into UltraDev now, maybe I can build a solution for you.
-HanengCharts Support
Pete | Posted 12:55am 13. August 2001 Server Time |
That would be excellent..!
Pete | Posted 6:09am 14. August 2001 Server Time |
Hi,
I am gettign a chart from a db but no labels.. here is my code please advise..
<HTML> <BODY> <CENTER> <applet code="HanengCharts.class" archive="HanengCharts2.jar" width=460 height=260> <param name="LicenseKey" value=":)Q!qB@&/6z-a["> <param name="ChartType" value="3Dbar"> <% Db = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" Db = Db & Server.MapPath("rmtcharts.mdb") & ";" Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open Db
SQL_query = "SELECT * FROM rmt where pl = '1050'" Set RS = MyConn.Execute(SQL_query) i=1
WHILE NOT RS.EOF %> <param name="Value_<%=i%>" value="<%=rs("Value")%>"> <% RS.MoveNext i=i+1 WEND RS.Close Set RS = nothing 'MyConn.Close 'Set MyConn = nothing
SQL_query = "SELECT * FROM rmt where pl = '1050'" Set RS = MyConn.Execute(SQL_query) i=1
WHILE NOT RS.EOF %> <param name="Text_1<%=i%>" value="<%=rs("HLABEL")%>"> <% RS.MoveNext i=i+1 WEND RS.Close Set RS = nothing MyConn.Close Set MyConn = nothing %>
</applet> </CENTER>
</BODY> </HTML>
HanengCharts Support | Posted 6:29am 14. August 2001 Server Time |
Hi Pete, I have downloaded the documentation for building UltraDev extensions and it is a lot to get into. I will try to build an HanengCharts extension in the near future.
About your problem: Try replacing the line: <param name="Text_1<%=i%>" value="<%=rs("HLABEL")%>"> With: <param name="Text_<%=i%>" value="<%=rs("HLABEL")%>">
The difference is the 1 you have forgot to remove in the name of the parameter (Text_1<%=i%> in stead of the correct Text_<%=i%>).
-HanengCharts Support
Pete | Posted 7:16am 14. August 2001 Server Time |
Support, I hope you guys do build a extension for UD it would be highly appreciated in the MM UD community people are looking for this solution in the newsgroups. Right now only 1 compnay (that I know of) supplies one for ud built by Web Assist but these charts are in flash and do not support recordesets only datasources but no criteria on it..
As for the problem thanks that took cared of it.. (p.s. I hope your next version will allow you to change the orientation of the labels
HanengCharts Support | Posted 8:44am 14. August 2001 Server Time |
Hi Pete, Do you have any links to the Web Assist extension or other extensions that you like so that we can see how others have done it?
-HanengCharts Support
Pete | Posted 10:50am 14. August 2001 Server Time |
Sure.. Webassist.com
Also check out www.asdb.org couple to look at for now.
UD extenstion would rock!
Pete | Posted 5:52am 15. August 2001 Server Time |
Say I had several different Dept I wanted to select from a drop down list. How would I set that up..? For example DeptA, DeptB and so forth. Then when the user select the dropdown it would show the chart based on the dept... Sounds simple..
HanengCharts Support | Posted 5:58am 15. August 2001 Server Time |
Hi Pete, First of all you need to add a field in your database called Dept that has the ID for the dept. Give the ID like 1, 2, 3 etc. (Where 1 is Dept. A etc.) Then you will have to have a form on one page like this: <HTML> <BODY> <FORM METHOD="POST" ACTION="Chart.asp"> Choose Dept.: <SELECT NAME="Dept"> <OPTION VALUE="1">Dept A <OPTION VALUE="2">Dept B <OPTION VALUE="3">Dept C </SELECT> <INPUT TYPE="SUBMIT" VALUE=" View Chart "> </FORM> </BODY> </HTML>
Chart.asp would look like this: <HTML> <BODY> <CENTER> <applet code="HanengCharts.class" archive="HanengCharts2.jar" width=460 height=260> <param name="LicenseKey" value=":)Q!qB@&/6z-a["> <param name="ChartType" value="3Dbar"> <% Db = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" Db = Db & Server.MapPath("rmtcharts.mdb") & ";" Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open Db
Form_Dept = Request.Form("Dept") SQL_query = "SELECT * FROM rmt where pl = '1050' AND Dept =" & Form_Dept Set RS = MyConn.Execute(SQL_query) i=1
WHILE NOT RS.EOF %> <param name="Value_<%=i%>" value="<%=rs("Value")%>"> <param name="Text_<%=i%>" value="<%=rs("HLABEL")%>"> <% RS.MoveNext i=i+1 WEND RS.Close Set RS = nothing MyConn.Close Set MyConn = nothing %> </applet> </CENTER> </BODY> </HTML>
-HanengCharts Support
Pete | Posted 6:34am 16. August 2001 Server Time |
what are the max line to post?
Pete | Posted 6:39am 16. August 2001 Server Time |
Two part post.. I want to change what the method above to select product a product line instead of a dept. When I select a product line from one page nothing happes to the charts page. (actually nothign happens) I have 2 tables one table that lists all the productlines value and a description the other table would select a description and a value and the product line value. Will I need a join for this? Here is some code from the selct page: <%@LANGUAGE="VBSCRIPT"%> <!--#include file="Connections/db.asp" --> <% set rsproductline = Server.CreateObject("ADODB.Recordset") rsproductline.ActiveConnection = MM_db_STRING rsproductline.Source = "SELECT * FROM productline" rsproductline.CursorType = 0 rsproductline.CursorLocation = 2 rsproductline.LockType = 3 rsproductline.Open() rsproductline_numRows = 0 %> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <p>Select Product Line</p> <form name="form1" method="post" action="Charts.asp"> <select name="selPL"> <option>[Select Product Line]</option> <% While (NOT rsproductline.EOF) %> <option value="<%=(rsproductline.Fields.Item("PL").Value)%>" ><%=(rsproductline.Fields.Item("Description").Value)%></option> <% rsproductline.MoveNext() Wend If (rsproductline.CursorType > 0) Then rsproductline.MoveFirst Else rsproductline.Requery End If %> </select> </form> <p> </p> </body> </html> <% rsproductline.Close() %>
View next post message for the chart.asp page (cont....)
Pete | Posted 6:40am 16. August 2001 Server Time |
Charts.asp page cont. from last post
<HTML> <BODY> <CENTER> <p> </p> <p><applet code="HanengCharts.class" archive="HanengCharts2.jar" width=528 height=338> <param name="LicenseKey" value="W).b@D(C3B+HC8%"> <param name="ChartType" value="bar"> <% Db = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" Db = Db & Server.MapPath("rmtcharts.mdb") & ";" Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open Db
form1 = Request.form("selPl") SQL_query = "SELECT * FROM rmt where pl = "& form1 Set RS = MyConn.Execute(SQL_query) i=1
WHILE NOT RS.EOF %> <param name="Value_<%=i%>" value="<%=rs("Value")%>"> <% RS.MoveNext i=i+1 WEND RS.Close Set RS = nothing 'MyConn.Close 'Set MyConn = nothing
form1 = Request.form("selPl") SQL_query = "SELECT * FROM rmt where pl = "& form1 Set RS = MyConn.Execute(SQL_query) i=1
WHILE NOT RS.EOF %> <param name="Text_<%=i%>" value="<%=rs("HLABEL")%>"> <param name="XAxisName" value="Quantity"> <param name="YAxisName" value="Reason"> <% RS.MoveNext i=i+1 WEND RS.Close Set RS = nothing MyConn.Close Set MyConn = nothing %> </applet></p> </CENTER> </BODY> </HTML>
Thanks In advance!
HanengCharts Support | Posted 6:42am 16. August 2001 Server Time |
You have forgotten to include a submit button: <INPUT TYPE="SUBMIT" VALUE=" Submit ">
-HanengCharts Support
Pete | Posted 6:45am 16. August 2001 Server Time |
DOH!
So no join is needed??
Well I got a little closer I get the following error: An error occured you must supply at least one parameter..
HanengCharts Support | Posted 6:51am 16. August 2001 Server Time |
You only have to include the lines once: <param name="XAxisName" value="Quantity"> <param name="YAxisName" value="Reason">
And there is no reason to the same search twice, just do it all at once: form1 = Request.form("selPl") SQL_query = "SELECT * FROM rmt where pl = "& form1 Set RS = MyConn.Execute(SQL_query) i=1 WHILE NOT RS.EOF %> <param name="Text_<%=i%>" value="<%=rs("HLABEL")%>"> <param name="Value_<%=i%>" value="<%=rs("Value")%>"> <% RS.MoveNext i=i+1 WEND RS.Close Set RS = nothing MyConn.Close Set MyConn = nothing
I am not sure what you mean by join.
The reason you get the "An error occured you must supply at least one parameter.." is that no valid value_x parameters was generated. View the HTML source in your web browser to check what is generated by ASP.
-HanengCharts Support
Pete | Posted 6:57am 16. August 2001 Server Time |
Will give it a whirl.. What I meant about join is JOINing the two table togethor? My initial post I expalined the scope of what I wanted to do and it is grabbing the product line info from one table and the charting values from another. So I thought I needed to JOIN them in my query..
By the way I appreciate your quick responses ! Awesome support...!
HanengCharts Support | Posted 7:42am 16. August 2001 Server Time |
IF you have two separat tables you can use a INNER JOIN to connect them together. See this article for more information: http://www.4guysfromrolla.com/webtech/050599-1.shtml
-HanengCharts Support
Pete | Posted 8:15am 16. August 2001 Server Time |
So what you are saying is that I NEED to?
HanengCharts Support | Posted 8:18am 16. August 2001 Server Time |
No. Both the HLABEL, the pl and the Value fields are in the rmt table, right?
-HanengCharts Support
Pete | Posted 8:36am 16. August 2001 Server Time |
Yes..
HanengCharts Support | Posted 11:50am 16. August 2001 Server Time |
Then you don't have to join them, just use the code I posted.
-HanengCharts Support
Pete | Posted 12:20am 16. August 2001 Server Time |
Darn, I am still getting the: "An error occured you must supply at least one parameter. message...
seem so close..
<HTML> <BODY> <CENTER> <p> </p> <p><applet code="HanengCharts.class" archive="HanengCharts2.jar" width=528 height=338> <param name="LicenseKey" value="W).b@D(C3B+HC8%"> <param name="ChartType" value="bar"> <% Db = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" Db = Db & Server.MapPath("rmtcharts.mdb") & ";" Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open Db
'pete form1 = Request.form("selPl") SQL_query = "SELECT * FROM rmt where pl = "& form1 Set RS = MyConn.Execute(SQL_query) i=1 WHILE NOT RS.EOF %> <param name="Text_<%=i%>" value="<%=rs("HLABEL")%>"> <param name="Value_<%=i%>" value="<%=rs("Value")%>"> <% RS.MoveNext i=i+1
WEND RS.Close Set RS = nothing MyConn.Close Set MyConn = nothing
RS.Close Set RS = nothing %> </applet></p> </CENTER> </BODY> </HTML>
Pete | Posted 1:32pm 16. August 2001 Server Time |
When I view source..
font face="Arial" size=2> <p>Microsoft OLE DB Provider for ODBC Drivers</font> <font face="Arial" size=2>error '80040e07'</font> <p> <font face="Arial" size=2>[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.</font> <p> <font face="Arial" size=2>/chart/Charts.asp</font><font face="Arial" size=2>, line 18</font>
HanengCharts Support | Posted 1:40pm 16. August 2001 Server Time |
The problem is in your SQL statement: SQL_query = "SELECT * FROM rmt where pl = "& form1
Try outputting it to see how it displays before you try to execute it. Also is pl a number? If not it should look like this: SQL_query = "SELECT * FROM rmt where pl LIKE '"& form1 & "'"
-HanengCharts Support
Pete | Posted 1:48pm 16. August 2001 Server Time |
Yes PL is a number it has the product line value number in it example 1050 , 2400 so forth
HanengCharts Support | Posted 2:02pm 16. August 2001 Server Time |
Well, I'm not sure what but there is something wrong in your database. Try this SQL query instead of the old one: SQL_query = "SELECT * FROM rmt where pl LIKE '"& TRIM(form1) & "'"
-HanengCharts Support
Pete | Posted 2:08pm 16. August 2001 Server Time |
Thus far I got this.. I will try the TRIM function next..
<HTML> <BODY> <CENTER> <p> </p> <p><applet code="HanengCharts.class" archive="HanengCharts2.jar" width=528 height=338> <param name="LicenseKey" value="W).b@D(C3B+HC8%"> <param name="ChartType" value="bar"> <font face="Arial" size=2> <p>Microsoft OLE DB Provider for ODBC Drivers</font> <font face="Arial" size=2>error '80040e14'</font> <p> <font face="Arial" size=2>[Microsoft][ODBC Microsoft Access Driver] Syntax error in string in query expression 'PL = 1350''.</font> <p> <font face="Arial" size=2>/chart/Charts.asp</font><font face="Arial" size=2>, line 22</font>
Pete | Posted 2:12pm 16. August 2001 Server Time |
bingo alex I got it.. the trim helped!
Pete | Posted 1:04pm 29. August 2001 Server Time |
I want to do the following: I have data in a database that I would like to chart. When a user goes to blah/charts.asp I would present them with a drop down list of product lines. Each product line will have 3 different charting metrics. So I would want the user to select product line then based on that product line to have an option to select which chart they would want to view out of the 3 each chart info would have its own table associate with it. Each table would have the associated producline in it. How do I go about this..? Please advise thanks!
HanengCharts Support | Posted 3:11am 30. August 2001 Server Time |
Hi, That will require some ASP coding. What you need to do is to make a 3 ASP pages. The first page should be a regular HTML form with a drop down from populated with the product line names. When the user have selected the product line and clicked the Next button he should be transfered to page number 2. Here you need to collect the name of the product line. You would then have another HTML chart with a new drop down box populated with the charting metrics for that product line. On the last page you will need to collect both the product line and metric to make a search in the database to populate the chart with data.
-HanengCharts Support
Pete | Posted 12:26am 4. September 2001 Server Time |
Ok- you think you can whip out some code sample(s) for this?
HanengCharts Support | Posted 2:53pm 4. September 2001 Server Time |
Sure, just post some more info about how your database is set up and I can make a quick sample script for you. If the database is an Access mdb file just email it to me at sales@haneng.com
-HanengCharts Support
Jimmy Niles | Posted 11:48am 9. October 2001 Server Time |
I've managed to run the demo from an "asp" page with a little modification to the demo page. My question is can you run the charts from a query inside a Microsoft Access database. I've got several other asp pages that I'm using and would like to use the same code to create a chart from them.
The following is a portion of the existing code:
<% sql = "SELECT Room_Master.Use, Use.Use_Description, Sum(Room_Master.Room_Area) AS SumOfRoom_Area FROM Room_Master INNER JOIN Use ON Room_Master.Use = Use.Use_Code " If cstr(Param) <> "" And cstr(Data) <> "" Then sql = sql & " WHERE [" & cstr(Param) & "] = " & cstr(Data) End If sql = sql & " GROUP BY Room_Master.Use, Use.Use_Description HAVING (((Room_Master.Use) Between '100' And '990')) ORDER BY Room_Master.Use " Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql, conn, 3, 3 %>
Now, how do I turn the above sql statement into workable language for the charting.
I appreciate your help.
HanengCharts Support | Posted 12:48am 9. October 2001 Server Time |
Hi, We where not sure whicj of the three values you wanted to use, but please try the code below and let us know how it works:
<HTML> <BODY>
<!-- Start HanengCharts Code --> <CENTER> <APPLET CODE="HanengCharts.class" ARCHIVE="HanengCharts2.jar" WIDTH=460 HEIGHT=260> <PARAM NAME="LicenseKey" VALUE="Cut & Paste Your License Key In Here"> <PARAM NAME="ChartType" VALUE="3dbar"> <% sql = "SELECT Room_Master.Use, Use.Use_Description, Sum(Room_Master.Room_Area) AS SumOfRoom_Area FROM Room_Master INNER JOIN Use ON Room_Master.Use = Use.Use_Code " If cstr(Param) <> "" And cstr(Data) <> "" Then sql = sql & " WHERE [" & cstr(Param) & "] = " & cstr(Data) End If sql = sql & " GROUP BY Room_Master.Use, Use.Use_Description HAVING (((Room_Master.Use) Between '100' And '990')) ORDER BY Room_Master.Use "
Set RS = conn.Execute(sql) ParameterCounter = 1 WHILE NOT RS.EOF %> <PARAM NAME="Text_<%=ParameterCounter%>" VALUE="<%=TRIM(RS("Use_Description"))%>"> <PARAM NAME="Value_<%=ParameterCounter%>" VALUE="<%=TRIM(RS("SumOfRoom"))%>"> <% ParameterCounter = ParameterCounter + 1 RS.MoveNext WEND RS.Close Set RS = nothing %> </APPLET> </CENTER> <!-- End HanengCharts Code -->
</BODY> </HTML>
-HanengCharts Support
Jimmy Niles | Posted 1:35pm 9. October 2001 Server Time |
As suggested, I copied the coding into an asp page (see below) and I still get an error:
<HTML> <BODY>
<!-- Start HanengCharts Code --> <CENTER> <APPLET CODE="HanengCharts.class" ARCHIVE="HanengCharts2.jar" WIDTH=460 HEIGHT=260> <PARAM NAME="LicenseKey" VALUE="W:/4XW+X%!]7ZQ"> <PARAM NAME="ChartType" VALUE="3dbar"> <% sql = "SELECT Room_Master.Use, Use.Use_Description, Sum(Room_Master.Room_Area) AS SumOfRoom_Area FROM Room_Master INNER JOIN
Use ON Room_Master.Use = Use.Use_Code " If cstr(Param) <> "" And cstr(Data) <> "" Then sql = sql & " WHERE [" & cstr(Param) & "] = " & cstr(Data) End If sql = sql & " GROUP BY Room_Master.Use, Use.Use_Description HAVING (((Room_Master.Use) Between '100' And '990')) ORDER BY
Room_Master.Use "
Set RS = conn.Execute(sql) ParameterCounter = 1 WHILE NOT RS.EOF %> <PARAM NAME="Text_<%=ParameterCounter%>" VALUE="<%=TRIM(RS("Use_Description"))%>"> <PARAM NAME="Value_<%=ParameterCounter%>" VALUE="<%=TRIM(RS("SumOfRoom"))%>"> <% ParameterCounter = ParameterCounter + 1 RS.MoveNext WEND RS.Close Set RS = nothing %> </APPLET> </CENTER> <!-- End HanengCharts Code -->
</BODY> </HTML>
Error Message from IE:
Microsoft VBScript runtime (0x800A01A8) Object required: 'conn' /designer/hanengcharts2.asp, line 16
The question that I have is, did you leave out the database connection for a reason (as I used in the demo asp):
Db = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" Db = Db & Server.MapPath("HanengCharts_Database.mdb") & ";" Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open Db
I have also added the coding which I had to use for the original demo to work:
<HTML> <BODY>
<CENTER> <APPLET CODE="HanengCharts.class" ARCHIVE="HanengCharts2.jar" WIDTH=600 HEIGHT=350> <PARAM NAME="LicenseKey" VALUE="WWq-@R#[[FH6+/"> <PARAM NAME="ChartType" VALUE="pie">
<% Db = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" Db = Db & Server.MapPath("HanengCharts_Database.mdb") & ";" Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open Db
SQL_query = "SELECT * FROM Products"
Set RS = MyConn.Execute(SQL_query) i=1 WHILE NOT RS.EOF
%>
<PARAM NAME="Text_<%=i%>" VALUE="<%=TRIM(RS("ProductName"))%>"> <PARAM NAME="Value_<%=i%>" VALUE="<%=TRIM(RS("Sold"))%>"> <PARAM NAME="Label_<%=i%>" VALUE="<%=TRIM(RS("ProductName"))%>">
<%
RS.MoveNext i=i+1
WEND
RS.Close Set RS = nothing MyConn.Close Set MyConn = nothing
%>
</APPLET> </CENTER> </BODY> </HTML>
I appreciate your help. Your were correct in the two fields that you picked. Also, my query in the database is "query1" and the database name is HanengCharts_Database.mdb and the tables that are listed in this database are:
Room_Master Building Program_Class Products Department Use
HanengCharts Support | Posted 3:12pm 9. October 2001 Server Time |
Hi, >The question that I have is, did you leave out the >database connection for a reason Since you used conn (instead of the MyConn in the demo) I assumed that your connection information existed somewhere above the code. You must of course connect to the database and the connection must be named conn, so you should add this code above the last code: <% Db = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" Db = Db & Server.MapPath("HanengCharts_Database.mdb") & ";" Set conn = Server.CreateObject("ADODB.Connection") conn.Open Db %> The lack of this is what is giving you the error.
I'm not sure how to call searches that are saved inside the Access database, but I think it is pretty much the same as with Stored Procedures for SQL Server. My guess would be:
sql = "EXECUTE query1"
-HanengCharts Support
Smithers | Posted 10:26am 10. October 2001 Server Time |
Hey guys,
Learn a little about ASP and database connections before you pester Support with these questions. They've really got nothing to do with the charts.
Haneng could've released a new version if he wasn't so busy answering these questions! :)
Don DeMaio | Posted 11:39am 10. October 2001 Server Time |
Alex, the chart app works great except it starts the Y axis at 0 and goes to the highest number in the dataset.
I'd like to start the Y axis at more than zero -- say, my dataset number minus 10 and go only to the dataset number plus 10.
How can I do this??
Thanks. Don
HanengCharts Support | Posted 1:36pm 10. October 2001 Server Time |
Hi, Use the GridStart and GridStop parameters: <PARAM NAME="GridStart" VALUE="10"> <PARAM NAME="GridStop" VALUE="50">
-HanengCharts Support
Allie | Posted 11:34am 24. October 2001 Server Time |
In our database we have 4 sites. Each site has a number of items to return. I would like to return a chart that gives us the total # of items for each site. When I use the code sample on the ASP page my parameter reads for the same site several hundred times before switching to the next site. Needless to say are chart is very funky and it doesn't look right. Is there a way to sum the value withing the parameter statements to get the plant names and then return the # of items for each?
HanengCharts Support | Posted 12:44am 24. October 2001 Server Time |
Hi Allie,
There is no built in way to do this in HanengCharts, but it should be a very easy thing to do with SQL. The SQL statement you will need to use will of course depend if you mean the sum of how many different items are in the database or if you mean the total quantity of all the items added together.
Here is the first case: SELECT COUNT(*) AS Total FROM YourTable
And here is the second: SELECT SUM(Qty) AS Total FROM YourTable
Do this for each database and display the data with HanengCharts.
-HanengCharts Support
Serigne | Posted 7:59am 4. December 2001 Server Time |
When I test the pie chart using ASP everything works fine, but when the pie chart is part of an include file, the pie chart is not showing (When I see the ASP result, all values are listing, but the chart is not showing). Did you have any issues with include files before
HanengCharts Support | Posted 12:10am 5. December 2001 Server Time |
No, that shouldn't be a problem. Check the source you get from your browser (Show->Source) and check that all the HanengCharts code is showing correctly.
-HanengCharts Support
cicco | Posted 6:01am 10. December 2001 Server Time |
malaus
jenn | Posted 7:44am 16. January 2002 Server Time |
Hi,
I have to show a few charts (pie or bar, or bars) using same recordset on the same page to display different data. How can I do this? Also is there any way to show the description of the Y-axis value?
Your responses are greately appreciated!
HanengCharts Support | Posted 9:21am 16. January 2002 Server Time |
Hi Jenn, Yes, and it is easy: Just cut and paste the same HanengCharts code several times on the same page and change the ChartType parameters for each code.
You can use the Label_x parameter to make mouse over labels for the pie slice or bar.
-HanengCharts Support
jenn | Posted 12:01am 16. January 2002 Server Time |
Thanks for response.
But it didn't work or I did something wrong?
My code is here:
<!-- HanengCharts Code Starts Here --> <CENTER> <APPLET CODE="HanengCharts.class" ARCHIVE="HanengCharts2.jar" WIDTH=550 HEIGHT=250>
<PARAM NAME="LicenseKey" VALUE=":W%#b3gW.+F4.&">
ParameterCounter = 1
'Beginning rs.MoveFirst end if
Do while Not rs.EOf 'I got data here display them in the charts
<PARAM NAME="ChartType" VALUE="multi3dbar"> <PARAM NAME="text_<%=ParameterCounter%>" VALUE=<%=ParameterCounter%>> <PARAM NAME="value_a_<%=ParameterCounter%>" VALUE=<% = y1 %>> <PARAM NAME="value_b_<%=ParameterCounter%>" VALUE=<% = y2 %>> <PARAM NAME="value_c_<%=ParameterCounter%>" VALUE=<% = y3 %>> <PARAM NAME="value_d_<%=ParameterCounter%>" VALUE=<% = y4 %>>
<PARAM NAME="DataSet_a" VALUE="rating 1"> <PARAM NAME="DataSet_b" VALUE="rating 2"> <PARAM NAME="DataSet_c" VALUE="rating 3"> <PARAM NAME="DataSet_d" VALUE="rating 4"> <PARAM NAME="ChartType" VALUE="multi3dbar">
<PARAM NAME="text_<%=ParameterCounter%>" VALUE=<%=ParameterCounter%>> <PARAM NAME="value_a_<%=ParameterCounter%>" VALUE=<% = n1 %>> <PARAM NAME="value_b_<%=ParameterCounter%>" VALUE=<% = n2 %>> <PARAM NAME="value_c_<%=ParameterCounter%>" VALUE=<% = n3 %>> <PARAM NAME="value_d_<%=ParameterCounter%>" VALUE=<% = n4 %>>
<PARAM NAME="DataSet_a" VALUE="rating 1"> <PARAM NAME="DataSet_b" VALUE="rating 2"> <PARAM NAME="DataSet_c" VALUE="rating 3"> <PARAM NAME="DataSet_d" VALUE="rating 4">
<%
ParameterCounter = ParameterCounter + 1 rs.MoveNext
Loop
rs.Close set rs=nothing
%> </CENTER> </APPLET>
jenn | Posted 12:01am 16. January 2002 Server Time |
Thanks for response.
But it didn't work or I did something wrong?
My code is here:
<!-- HanengCharts Code Starts Here --> <CENTER> <APPLET CODE="HanengCharts.class" ARCHIVE="HanengCharts2.jar" WIDTH=550 HEIGHT=250>
<PARAM NAME="LicenseKey" VALUE=":W%#b3gW.+F4.&">
ParameterCounter = 1
'Beginning rs.MoveFirst end if
Do while Not rs.EOf 'I got data here display them in the charts
<PARAM NAME="ChartType" VALUE="multi3dbar"> <PARAM NAME="text_<%=ParameterCounter%>" VALUE=<%=ParameterCounter%>> <PARAM NAME="value_a_<%=ParameterCounter%>" VALUE=<% = y1 %>> <PARAM NAME="value_b_<%=ParameterCounter%>" VALUE=<% = y2 %>> <PARAM NAME="value_c_<%=ParameterCounter%>" VALUE=<% = y3 %>> <PARAM NAME="value_d_<%=ParameterCounter%>" VALUE=<% = y4 %>>
<PARAM NAME="DataSet_a" VALUE="rating 1"> <PARAM NAME="DataSet_b" VALUE="rating 2"> <PARAM NAME="DataSet_c" VALUE="rating 3"> <PARAM NAME="DataSet_d" VALUE="rating 4"> <PARAM NAME="ChartType" VALUE="multi3dbar">
<PARAM NAME="text_<%=ParameterCounter%>" VALUE=<%=ParameterCounter%>> <PARAM NAME="value_a_<%=ParameterCounter%>" VALUE=<% = n1 %>> <PARAM NAME="value_b_<%=ParameterCounter%>" VALUE=<% = n2 %>> <PARAM NAME="value_c_<%=ParameterCounter%>" VALUE=<% = n3 %>> <PARAM NAME="value_d_<%=ParameterCounter%>" VALUE=<% = n4 %>>
<PARAM NAME="DataSet_a" VALUE="rating 1"> <PARAM NAME="DataSet_b" VALUE="rating 2"> <PARAM NAME="DataSet_c" VALUE="rating 3"> <PARAM NAME="DataSet_d" VALUE="rating 4">
<%
ParameterCounter = ParameterCounter + 1 rs.MoveNext
Loop
rs.Close set rs=nothing
%> </CENTER> </APPLET>
jenn | Posted 12:01am 16. January 2002 Server Time |
Thanks for response.
But it didn't work or I did something wrong?
My code is here:
<!-- HanengCharts Code Starts Here --> <CENTER> <APPLET CODE="HanengCharts.class" ARCHIVE="HanengCharts2.jar" WIDTH=550 HEIGHT=250>
<PARAM NAME="LicenseKey" VALUE=":W%#b3gW.+F4.&">
ParameterCounter = 1
'Beginning rs.MoveFirst end if
Do while Not rs.EOf 'I got data here display them in the charts
<PARAM NAME="ChartType" VALUE="multi3dbar"> <PARAM NAME="text_<%=ParameterCounter%>" VALUE=<%=ParameterCounter%>> <PARAM NAME="value_a_<%=ParameterCounter%>" VALUE=<% = y1 %>> <PARAM NAME="value_b_<%=ParameterCounter%>" VALUE=<% = y2 %>> <PARAM NAME="value_c_<%=ParameterCounter%>" VALUE=<% = y3 %>> <PARAM NAME="value_d_<%=ParameterCounter%>" VALUE=<% = y4 %>>
<PARAM NAME="DataSet_a" VALUE="rating 1"> <PARAM NAME="DataSet_b" VALUE="rating 2"> <PARAM NAME="DataSet_c" VALUE="rating 3"> <PARAM NAME="DataSet_d" VALUE="rating 4"> <PARAM NAME="ChartType" VALUE="multi3dbar">
<PARAM NAME="text_<%=ParameterCounter%>" VALUE=<%=ParameterCounter%>> <PARAM NAME="value_a_<%=ParameterCounter%>" VALUE=<% = n1 %>> <PARAM NAME="value_b_<%=ParameterCounter%>" VALUE=<% = n2 %>> <PARAM NAME="value_c_<%=ParameterCounter%>" VALUE=<% = n3 %>> <PARAM NAME="value_d_<%=ParameterCounter%>" VALUE=<% = n4 %>>
<PARAM NAME="DataSet_a" VALUE="rating 1"> <PARAM NAME="DataSet_b" VALUE="rating 2"> <PARAM NAME="DataSet_c" VALUE="rating 3"> <PARAM NAME="DataSet_d" VALUE="rating 4">
<%
ParameterCounter = ParameterCounter + 1 rs.MoveNext
Loop
rs.Close set rs=nothing
%> </CENTER> </APPLET>
HanengCharts Support | Posted 12:05am 16. January 2002 Server Time |
Hi, Did you forget the <% and %> before and after:
ParameterCounter = 1
'Beginning rs.MoveFirst
Do while Not rs.EOf 'I got data here display them in the charts
And is the End if misplaced?
-HanengCharts Support
jenn | Posted 12:06am 16. January 2002 Server Time |
Sorry I think I hit the wrong key while I was typping.
I did get one chart correct. But without any change after I added another chart code. Somewhere I should specify the chart name or something? how can I set the alignment of the charts?
thanks.
HanengCharts Support | Posted 12:08am 16. January 2002 Server Time |
Send the complete code to sales@haneng.com and I will take a look at it.
You can align charts by placing them into a table.
-HanengCharts Support
jenn | Posted 12:40am 16. January 2002 Server Time |
Please ignore the mistake by typping. there is nothing wrong with the sql since I already got the numbers displayed. I'm trying to convert it to bar chart or pie chart using HanengChart. I'm glad to see one chart displayed nicely and correctly. Just can not get two or more charts out. Please help.
thanks.
HanengCharts Support | Posted 12:41am 16. January 2002 Server Time |
Email the full code to me so I can have a look at it please: sales@haneng.com
-HanengCharts Support
David B. | Posted 3:33pm 10. July 2002 Server Time |
Is there any way of changing the labels alignment to be vertical and not horizontal. The reason I ask is I am using dates (07/02/2002) as the text_x values and I am having to stretch the chart way out to get the amount of data I need. Changing the alignment of the text would save me some screen real-estate.
HanengCharts Support | Posted 5:48pm 10. July 2002 Server Time |
Hi David, There is no way in version 2.0, but there is in 2.5. Click the beta link on the left menu and download the latest 2.5 beta for examples on how to do it.
-HanengCharts Support
David B. | Posted 7:04am 11. July 2002 Server Time |
Does this vertical x-axis text work on a multi-line chart?
HanengCharts Support | Posted 9:50pm 11. July 2002 Server Time |
Hi David, Yes it does.
-HanengCharts Support
gavin h | Posted 8:26am 18. July 2002 Server Time |
my project at the moment involves online database using asp what is rthe correct syntax for creating an inner join in sql for asp not this anyway "SELECT * FROM DOCUMENT INNERJOIN DOCSandKEYS WHERE DOCSandKEYS.Keyword LIKE '"&Request.Form("in")&"'"
i have also tied this "SELECT * FROM DOCUMENT, DOCSandKEYS WHERE DOCSandKEYS.Keyword LIKE '"&Request.Form("in")&"'" doesnt work either
HanengCharts Support | Posted 8:36am 19. July 2002 Server Time |
Well if we say we have the tables A and B and they both have a field called ID that we want to join the tables on the syntax would be:
SELECT * FROM A INNER JOIN B ON (A.ID = B.ID)
-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
|
|