close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

combine chart w session variables

Thread began 3/31/2011 1:13 pm by davedvst392699 | Last modified 4/04/2011 2:02 pm by Jason Byrnes | 2326 views | 10 replies |

davedvst392699

combine chart w session variables

DynamicWebCharts/Data/AAABar1_dataparser1.asp?accessdenied=/AAABar1.asp Is the message i keep getting when trying to view a chart i combined following the instructions from the solution videos. I am able to view them individually but once I try combining the two this happens. I have tried several times to no success. Wondering if you might be able to see where i made my mistakes. below i have pasted the 2 data .asp files i am working with. thanks

This is the page im combining in below this code is the second data.asp im taking from to combine in this one.

main page 1

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="\Connections\usertest.asp" -->
<%
Dim WADWCdboYTDTOTAL__ParamSM
WADWCdboYTDTOTAL__ParamSM = "0"
If (Request.QueryString("session_RepID") <> "") Then
WADWCdboYTDTOTAL__ParamSM = Request.QueryString("session_RepID")
End If
%>
<%
Dim WADWCdboYTDTOTAL
Dim WADWCdboYTDTOTAL_cmd
Dim WADWCdboYTDTOTAL_numRows

Set WADWCdboYTDTOTAL_cmd = Server.CreateObject ("ADODB.Command")
WADWCdboYTDTOTAL_cmd.ActiveConnection = MM_usertest_STRING
WADWCdboYTDTOTAL_cmd.CommandText = "SELECT LEFT(DATENAME(month, DATE), 3) + ' ' + LTRIM(STR(DAY(DATE))) + ', ' + LTRIM(YEAR(DATE)) AS XLABEL, SUM(Amount) AS YVALUE FROM dbo.YTDTOTAL WHERE SM LIKE ? GROUP BY LEFT(DATENAME(month, DATE), 3) + ' ' + LTRIM(STR(DAY(DATE))) + ', ' + LTRIM(YEAR(DATE)), DATEPART(year, DATE), DATEPART(month, DATE), DATEPART(day, DATE) ORDER BY DATEPART(year, DATE), DATEPART(month, DATE), DATEPART(day, DATE)"
WADWCdboYTDTOTAL_cmd.Prepared = true
WADWCdboYTDTOTAL_cmd.Parameters.Append WADWCdboYTDTOTAL_cmd.CreateParameter("param1", 201, 1, 10, WADWCdboYTDTOTAL__ParamSM) ' adLongVarChar

Set WADWCdboYTDTOTAL = WADWCdboYTDTOTAL_cmd.Execute
WADWCdboYTDTOTAL_numRows = 0
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_usertest_STRING
Recordset1_cmd.CommandText = "SELECT LEFT(DATENAME(month, DATE), 3) + ' ' + LTRIM(STR(DAY(DATE))) + ', ' + LTRIM(YEAR(DATE)) AS XLABEL, SUM(Cost) AS YVALUE FROM dbo.YTDTOTAL GROUP BY LEFT(DATENAME(month, DATE), 3) + ' ' + LTRIM(STR(DAY(DATE))) + ', ' + LTRIM(YEAR(DATE)), DATEPART(year, DATE), DATEPART(month, DATE), DATEPART(day, DATE) ORDER BY DATEPART(year, DATE), DATEPART(month, DATE), DATEPART(day, DATE)"
Recordset1_cmd.Prepared = true

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim WADWCdboYTDTOTAL__numRows
Dim WADWCdboYTDTOTAL__index

WADWCdboYTDTOTAL__numRows = -1
WADWCdboYTDTOTAL__index = 0
WADWCdboYTDTOTAL_numRows = WADWCdboYTDTOTAL_numRows + WADWCdboYTDTOTAL__numRows
%>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wa_dwc SYSTEM "wa_dwc.dtd">
<wa_dwc name="AmountAvePreset" version="1.0.0">
<color_wheel name="SLATE">
<color>#00FF00</color>
<color>#d8dcbf</color>
<color>#777890</color>
<color>#b0b6bd</color>
<color>#eaebfc</color>
<color>#a2a5b9</color>
</color_wheel>
<title style=" font-size:16px; color:#d7e6f9; text-align:center;">Revenue%20Totals</title>
<background color="#0c0b12" align="left" valign="top"/>
<innerbg startcolor="#50516b" endcolor="#2d2b2e" direction="90"/>
<yaxis color="#888d93" gridcolor="#767a7f">
<labels size="11" fontcolor="#e3e3e4" linecolor="#767a7f">
</labels>
<legend size="12" color="#d7e6f9">Amount</legend>
</yaxis>
<xaxis color="#999999" gridcolor="#FF6600" offset="true">
<legend size="12" color="#d7e6f9">Weeks</legend>
<labels size="11" fontcolor="#e3e3e4" orientation="0" linecolor="#767a7f">
</labels>
</xaxis>
<data>
<dataset type="bar" style="{font-size:9px;color:#888d93;}" size="9" width="2" color="#00FF00" label="range%20from%20Jan%201%202011" dotsize="5" opacity="80" abstraction="4" outline="#888d93" linecolor="#888d93" subtype="fade">
<%
While ((WADWCdboYTDTOTAL__numRows <> 0) AND (NOT WADWCdboYTDTOTAL.EOF))
%><point >
<label><%=(WADWCdboYTDTOTAL.Fields.Item("XLABEL").Value)%></label>
<value><%=(WADWCdboYTDTOTAL.Fields.Item("YVALUE").Value)%></value>
</point><%
WADWCdboYTDTOTAL__index=WADWCdboYTDTOTAL__index+1
WADWCdboYTDTOTAL__numRows=WADWCdboYTDTOTAL__numRows-1
WADWCdboYTDTOTAL.MoveNext()
Wend
%>
</dataset>
<dataset axis="right" type="line" style="{font-size:9px;color:#888d93;}" size="9" width="2" color="#FF9900" label="cost%20range%20from%20Jan%201%202011" dotsize="5" opacity="80" abstraction="4" outline="#888d93" linecolor="#888d93" subtype="dot">
<%
While ((WADWCdboYTDTOTAL__numRows <> 0) AND (NOT WADWCdboYTDTOTAL.EOF))
%><point >
<label><%=(WADWCdboYTDTOTAL.Fields.Item("XLABEL").Value)%></label>
<value><%=(WADWCdboYTDTOTAL.Fields.Item("YVALUE").Value)%></value>
</point><%
WADWCdboYTDTOTAL__index=WADWCdboYTDTOTAL__index+1
WADWCdboYTDTOTAL__numRows=WADWCdboYTDTOTAL__numRows-1
WADWCdboYTDTOTAL.MoveNext()
Wend
%>
</dataset>
</data><rightyaxis><legend size="12" color="#d7e6f9">Cost</legend></rightyaxis>
</wa_dwc>
<%
WADWCdboYTDTOTAL.Close()
Set WADWCdboYTDTOTAL = Nothing
%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>


Page 2
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="\Connections\usertest.asp" -->
<%
Dim WADWCdboYTDTOTAL
Dim WADWCdboYTDTOTAL_cmd
Dim WADWCdboYTDTOTAL_numRows

Set WADWCdboYTDTOTAL_cmd = Server.CreateObject ("ADODB.Command")
WADWCdboYTDTOTAL_cmd.ActiveConnection = MM_usertest_STRING
WADWCdboYTDTOTAL_cmd.CommandText = "SELECT LEFT(DATENAME(month, DATE), 3) + ' ' + LTRIM(STR(DAY(DATE))) + ', ' + LTRIM(YEAR(DATE)) AS XLABEL, SUM(Cost) AS YVALUE FROM dbo.YTDTOTAL GROUP BY LEFT(DATENAME(month, DATE), 3) + ' ' + LTRIM(STR(DAY(DATE))) + ', ' + LTRIM(YEAR(DATE)), DATEPART(year, DATE), DATEPART(month, DATE), DATEPART(day, DATE) ORDER BY DATEPART(year, DATE), DATEPART(month, DATE), DATEPART(day, DATE)"
WADWCdboYTDTOTAL_cmd.Prepared = true

Set WADWCdboYTDTOTAL = WADWCdboYTDTOTAL_cmd.Execute
WADWCdboYTDTOTAL_numRows = 0
%>
<%
Dim WADWCdboYTDTOTAL__numRows
Dim WADWCdboYTDTOTAL__index

WADWCdboYTDTOTAL__numRows = -1
WADWCdboYTDTOTAL__index = 0
WADWCdboYTDTOTAL_numRows = WADWCdboYTDTOTAL_numRows + WADWCdboYTDTOTAL__numRows
%>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wa_dwc SYSTEM "wa_dwc.dtd">
<wa_dwc name="AmountAvePreset" version="1.0.0">
<color_wheel name="SLATE">
<color>#FF9900</color>
<color>#d8dcbf</color>
<color>#777890</color>
<color>#b0b6bd</color>
<color>#eaebfc</color>
<color>#a2a5b9</color>
</color_wheel>
<title style=" font-size:16px; color:#d7e6f9; text-align:center; titleText:;"></title>
<background color="#0c0b12" align="left" valign="top"/>
<innerbg startcolor="#50516b" endcolor="#2d2b2e" direction="90"/>
<yaxis color="#888d93" gridcolor="#767a7f">
<labels size="11" fontcolor="#e3e3e4" linecolor="#767a7f">
</labels>
<legend size="12" color="#d7e6f9">Amount</legend>
</yaxis>
<xaxis color="#999999" gridcolor="#FF6600" offset="true">
<legend size="12" color="#d7e6f9">Weeks</legend>
<labels size="11" fontcolor="#e3e3e4" orientation="0" linecolor="#767a7f">
</labels>
</xaxis>
<data>
<dataset type="line" style="{font-size:9px;color:#888d93;}" size="9" width="2" color="#FF9900" label="Cost%20range%20from%20Jan%201%202011" dotsize="5" opacity="80" abstraction="4" outline="#888d93" linecolor="#888d93" subtype="dot">
<%
While ((WADWCdboYTDTOTAL__numRows <> 0) AND (NOT WADWCdboYTDTOTAL.EOF))
%><point >
<label><%=(WADWCdboYTDTOTAL.Fields.Item("XLABEL").Value)%></label>
<value><%=(WADWCdboYTDTOTAL.Fields.Item("YVALUE").Value)%></value>
</point><%
WADWCdboYTDTOTAL__index=WADWCdboYTDTOTAL__index+1
WADWCdboYTDTOTAL__numRows=WADWCdboYTDTOTAL__numRows-1
WADWCdboYTDTOTAL.MoveNext()
Wend
%>
</dataset>
</data>
</wa_dwc>
<%
WADWCdboYTDTOTAL.Close()
Set WADWCdboYTDTOTAL = Nothing
%>
thanks in advance
Dave

Sign in to reply to this post

Jason ByrnesWebAssist

please send a link where i can see the problem. and a copy of the DynamicWebCharts/Data/AAABar1_dataparser1.asp file in a zip archive.

Sign in to reply to this post

davedvst392699

combine chart w sessions var files

I have attached zip file with both charts, data and dataparser files along with http addresses and needed info to view. Let me know if you need or i have forgotten anything.
appreciate the time.
Dave

Attached Files
aaabarlinechartcombine.zip
Sign in to reply to this post

Jason ByrnesWebAssist

in the DynamicWebCharts/Data/AAABar1_data2.asp file, delete the following lines:
Dim WADWCdboYTDTOTAL
Dim WADWCdboYTDTOTAL_cmd
Dim WADWCdboYTDTOTAL_numRows

Sign in to reply to this post

davedvst392699

combine chart w sessions var

I have deleted the lines you suggested and get the same error. Do i need to remove the same lines from the second dataset as well (Recordset 1)?

Sign in to reply to this post

Jason ByrnesWebAssist

if i access the data page directly I see the following error:
DynamicWebCharts/Data/AAABar1_data2.asp?


Microsoft VBScript compilation error '800a0401'

Expected end of statement

/DynamicWebCharts/Data/AAABar1_data2.asp, line 75

WADWCdboYTDTOTAL__numRows=WADWCdboYTDTOTAL__numRow s-1



looks like line 75 is:
WADWCdboYTDTOTAL__numRows=WADWCdboYTDTOTAL__numRow s-1


but it should be:
WADWCdboYTDTOTAL__numRows=WADWCdboYTDTOTAL__numRows-1

Sign in to reply to this post

davedvst392699

combine chart w sessions var

Im not sure what you mean.
the line 75 line looks exactly like what i need to change it to and what it seems to already be. Am i missing a subtle difference?

Sign in to reply to this post

Jason ByrnesWebAssist

the end:
numRow s-1

should not have the space between the w and s:
numRows-1

Sign in to reply to this post

davedvst392699

combine chart w sessions var

I have made all the recommended changes so far and still no success. I have re-pasted the AAABar1.asp with all the changes so far. Let me know if i have messed up anything.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="\Connections\usertest.asp" -->
<%
Dim WADWCdboYTDTOTAL__ParamSM
WADWCdboYTDTOTAL__ParamSM = "0"
If (Request.QueryString("session_RepID") <> "") Then
WADWCdboYTDTOTAL__ParamSM = Request.QueryString("session_RepID")
End If
%>
<%
Set WADWCdboYTDTOTAL_cmd = Server.CreateObject ("ADODB.Command")
WADWCdboYTDTOTAL_cmd.ActiveConnection = MM_usertest_STRING
WADWCdboYTDTOTAL_cmd.CommandText = "SELECT LEFT(DATENAME(month, DATE), 3) + ' ' + LTRIM(STR(DAY(DATE))) + ', ' + LTRIM(YEAR(DATE)) AS XLABEL, SUM(Amount) AS YVALUE FROM dbo.YTDTOTAL WHERE SM LIKE ? GROUP BY LEFT(DATENAME(month, DATE), 3) + ' ' + LTRIM(STR(DAY(DATE))) + ', ' + LTRIM(YEAR(DATE)), DATEPART(year, DATE), DATEPART(month, DATE), DATEPART(day, DATE) ORDER BY DATEPART(year, DATE), DATEPART(month, DATE), DATEPART(day, DATE)"
WADWCdboYTDTOTAL_cmd.Prepared = true
WADWCdboYTDTOTAL_cmd.Parameters.Append WADWCdboYTDTOTAL_cmd.CreateParameter("param1", 201, 1, 10, WADWCdboYTDTOTAL__ParamSM) ' adLongVarChar

Set WADWCdboYTDTOTAL = WADWCdboYTDTOTAL_cmd.Execute
WADWCdboYTDTOTAL_numRows = 0
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_usertest_STRING
Recordset1_cmd.CommandText = "SELECT LEFT(DATENAME(month, DATE), 3) + ' ' + LTRIM(STR(DAY(DATE))) + ', ' + LTRIM(YEAR(DATE)) AS XLABEL, SUM(Cost) AS YVALUE FROM dbo.YTDTOTAL GROUP BY LEFT(DATENAME(month, DATE), 3) + ' ' + LTRIM(STR(DAY(DATE))) + ', ' + LTRIM(YEAR(DATE)), DATEPART(year, DATE), DATEPART(month, DATE), DATEPART(day, DATE) ORDER BY DATEPART(year, DATE), DATEPART(month, DATE), DATEPART(day, DATE)"
Recordset1_cmd.Prepared = true

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim WADWCdboYTDTOTAL__numRows
Dim WADWCdboYTDTOTAL__index

WADWCdboYTDTOTAL__numRows = -1
WADWCdboYTDTOTAL__index = 0
WADWCdboYTDTOTAL_numRows = WADWCdboYTDTOTAL_numRows + WADWCdboYTDTOTAL__numRows
%>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wa_dwc SYSTEM "wa_dwc.dtd">
<wa_dwc name="AmountAvePreset" version="1.0.0">
<color_wheel name="SLATE">
<color>#00FF00</color>
<color>#d8dcbf</color>
<color>#777890</color>
<color>#b0b6bd</color>
<color>#eaebfc</color>
<color>#a2a5b9</color>
</color_wheel>
<title style=" font-size:16px; color:#d7e6f9; text-align:center;">Revenue%20Totals</title>
<background color="#0c0b12" align="left" valign="top"/>
<innerbg startcolor="#50516b" endcolor="#2d2b2e" direction="90"/>
<yaxis color="#888d93" gridcolor="#767a7f">
<labels size="11" fontcolor="#e3e3e4" linecolor="#767a7f">
</labels>
<legend size="12" color="#d7e6f9">Amount</legend>
</yaxis>
<xaxis color="#999999" gridcolor="#FF6600" offset="true">
<legend size="12" color="#d7e6f9">Weeks</legend>
<labels size="11" fontcolor="#e3e3e4" orientation="0" linecolor="#767a7f">
</labels>
</xaxis>
<data>
<dataset type="bar" style="{font-size:9px;color:#888d93;}" size="9" width="2" color="#00FF00" label="range%20from%20Jan%201%202011" dotsize="5" opacity="80" abstraction="4" outline="#888d93" linecolor="#888d93" subtype="fade">
<%
While ((WADWCdboYTDTOTAL__numRows <> 0) AND (NOT WADWCdboYTDTOTAL.EOF))
%><point >
<label><%=(WADWCdboYTDTOTAL.Fields.Item("XLABEL"). Value)%></label>
<value><%=(WADWCdboYTDTOTAL.Fields.Item("YVALUE"). Value)%></value>
</point><%
WADWCdboYTDTOTAL__index=WADWCdboYTDTOTAL__index+1
WADWCdboYTDTOTAL__numRows=WADWCdboYTDTOTAL__numRows-1
WADWCdboYTDTOTAL.MoveNext()
Wend
%>
</dataset>
<dataset axis="right" type="line" style="{font-size:9px;color:#888d93;}" size="9" width="2" color="#FF9900" label="cost%20range%20from%20Jan%201%202011" dotsize="5" opacity="80" abstraction="4" outline="#888d93" linecolor="#888d93" subtype="dot">
<%
While ((WADWCdboYTDTOTAL__numRows <> 0) AND (NOT WADWCdboYTDTOTAL.EOF))
%><point >
<label><%=(WADWCdboYTDTOTAL.Fields.Item("XLABEL"). Value)%></label>
<value><%=(WADWCdboYTDTOTAL.Fields.Item("YVALUE"). Value)%></value>
</point><%
WADWCdboYTDTOTAL__index=WADWCdboYTDTOTAL__index+1
WADWCdboYTDTOTAL__numRows=WADWCdboYTDTOTAL__numRows-1
WADWCdboYTDTOTAL.MoveNext()
Wend
%>
</dataset>
</data><rightyaxis><legend size="12" color="#d7e6f9">Cost</legend></rightyaxis>
</wa_dwc>
<%
WADWCdboYTDTOTAL.Close()
Set WADWCdboYTDTOTAL = Nothing
%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

Sign in to reply to this post

davedvst392699

combine chart w sessions var

just wanted you to know that the script i just sent you for some reason seperates the w and s in the numrows-1 lines when i send it to you. In my code it has been corrected to your recommendations.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...