PDA

View Full Version : combine chart w session variables


davedvst392699
03-31-2011, 10:13 AM
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__numRow s-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__numRow s-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__numRow s-1
WADWCdboYTDTOTAL.MoveNext()
Wend
%>
</dataset>
</data>
</wa_dwc>
<%
WADWCdboYTDTOTAL.Close()
Set WADWCdboYTDTOTAL = Nothing
%>
thanks in advance
Dave

Jason Byrnes
03-31-2011, 11:52 AM
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.

davedvst392699
03-31-2011, 12:16 PM
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

Jason Byrnes
03-31-2011, 12:22 PM
in the DynamicWebCharts/Data/AAABar1_data2.asp file, delete the following lines:
Dim WADWCdboYTDTOTAL
Dim WADWCdboYTDTOTAL_cmd
Dim WADWCdboYTDTOTAL_numRows

davedvst392699
03-31-2011, 12:37 PM
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)?

Jason Byrnes
03-31-2011, 12:53 PM
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__numRow s-1

davedvst392699
03-31-2011, 01:08 PM
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?

Jason Byrnes
03-31-2011, 01:17 PM
the end:
numRow s-1

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

davedvst392699
03-31-2011, 01:36 PM
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__numRow s-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__numRow s-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
%>

davedvst392699
03-31-2011, 01:43 PM
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.

Jason Byrnes
04-04-2011, 11:02 AM
I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
http://www.webassist.com/mywebassist/supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.