Sign in to follow this  
Neverguesswho

Wrong Number Of Arguments Or Invalid Property Assignment

Recommended Posts

I ran into another problem and can't figure out a fix... This is my code

<%@ Language=VBScript %>
<!-- #INCLUDE FILE="FusionCharts.asp" -->
  <!-- #INCLUDE File="NewArray.asp" -->
  <!-- #INCLUDE File="DBConn2.asp" -->
  <!-- #INCLUDE File="RaceandColor.asp" -->
  <!-- #INCLUDE File="FC_Colors.asp" -->
  <!--#include file="FusionCharts_Gen.asp"-->
  <!-- #include virtual="nett/header.asp" -->

<html>
<head>


   	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

   	<title></title>
   	<link href="../assets/ui/css/style.css" rel="stylesheet" type="text/css" />
   	<script type="text/javascript" src="jquery.min.js"></script>

		<style type="text/css">

       	body,html,head,div{height:100%; min-height:100%;width:100%; }
   	</style>
	<script LANGUAGE="Javascript" SRC="FusionCharts.js"></SCRIPT>
</head>


<body >

               	<div class="gen-chart-render"  >
<%
Dim strParams, strQuery,today,minID, maxID, totalID, TableValues,siteID, siteName, currentDate, startOfStudy,midDate,results
dim count, numSites

set FC = new FusionCharts
Call FC.setChartType("StackedColumn3D")'change to multiseries Ychart
Call FC.setSize("90%","90%") 
call FC.setSWFPath("../testfiles/")
Call FC.setID("SiteEnrollment")
Set oConn = Server.CreateObject("ADODB.Connection")	
Set oRs = Server.CreateObject("ADODB.Recordset")
oConn.Open strConnQuery
today=Date()

  cateCount=0
  count = 1
  startOfStudy = "2000-01-01"
  currentDate=Date()
  midDate=DateAdd("m",-1,currentDate)
  call FC.addCategory("","","")

  strQuery = "Select zSiteID, zSiteNm from vSite"
  set ors = oConn.Execute(strQuery)
  TableValues=oRs.getRows()
  strQuery = "Select count(*) as total from vSite"
  set ors = oConn.Execute(strQuery)
  numSites = oRs("total")

  response.write(TableValues(1,10))
  response.Write(numSites)

  for x=0 to ubound(TableValues)

  siteID=TableValues(0,x)
  siteName=TableValues(1,x)
  strQuery="Select count(zsiteID) as number FROM vSubject Where zSiteID = "&siteID&" AND SubjectStartDate between '"&midDate&"' AND '"&currentDate&"' "
  set oRs=oConn.Execute(strQuery)
  response.Write("123")
  'results = oRs.getRows()
  response.Write("heys")
  'count = ubound(results) + 1
  response.Write("thuis")
  count = oRs("number")
  Call FC.createMSStDataset()
  Call FC.addMSStSubDataset("","")
  Call FC.addChartData(""&count&"","","")
  response.Write("that")
  strQuery="Select count(zsiteID) as number FROM vSubject Where zSiteID = "&siteID&" AND SubjectStartDate between '"&startOfStudy&"' AND '"&midDate&"' "
  set oRs=oConn.Execute(strQuery)
  'results = oRs.getRows()
  'count = ubound(results) + 1
  count = oRs("number")
  Call FC.addMSStSubDataset(""&siteName&"","")
  Call FC.addChartData(""&count&"","","")
  response.Write("here")
  x=x+1
 next

  strParam="caption=Annual Revenue"
  call FC.setChartParams(strparam)

  call FC.SetRenderer( "javascript" ) 
	response.Write("AAAA")
  call FC.renderChart(false)
	response.Write("AAAA")


%>

</body>
</html>

As you can see I have some response.writes in the code. I've figured out that is has to do with the FC.renderchart function. This is the error that i get(attached)Any advice or help would be great! :o

post-28394-0-74447200-1341515559_thumb.jpg

Edited by Neverguesswho

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

Did you get the chart XML?

 

If not, then try using static XML data first and let us know.

Share this post


Link to post
Share on other sites

Hi,

 

Did you get the chart XML?

 

If not, then try using static XML data first and let us know.

No I haven't been able to get the chart xml. I changed methods and started using the set FC = new FusionCharts(I think asp class) because I was unable to create the xml and have the chart render using javascript. If you can elaborate on where to find the current xml then that would be great!:lol: Or if you have any other advice Id appreciate it :D

Share this post


Link to post
Share on other sites
Guest Sumedh

This is what I have been using to write it and try to fix it.

 

Hi,

 

Please check your database connection.

 

You would need to configure the database connection according to your machine.

 

You can refer this link: http://www.connectionstrings.com/ for setting up the database.

 

Also, you can get the sample demo in the Download Package > Code > ASP > DBExample

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hi,

 

Please check your database connection.

 

You would need to configure the database connection according to your machine.

 

You can refer this link: http://www.connectionstrings.com/ for setting up the database.

 

Also, you can get the sample demo in the Download Package > Code > ASP > DBExample

 

Hope this helps.

 

I have already connected to the database and created several charts from the same database. I am using the same DBConn file as the other charts so I do not think that the connection is the problem. Do you have any other suggestions?

Share this post


Link to post
Share on other sites
Guest Sumedh

I have already connected to the database and created several charts from the same database. I am using the same DBConn file as the other charts so I do not think that the connection is the problem. Do you have any other suggestions?

 

Hi,

 

If you are able to render the charts then, what is your exact issue?

Share this post


Link to post
Share on other sites

Hi,

 

If you are able to render the charts then, what is your exact issue?

 

My problem is that it won't display and I can't find the error, I think it is in the render chart part . I have been able to render different charts with the same connection file so that isn't it. I thought I had pretty much the same format for this chart as the examples.

 

My goal is trying to display all/some of the sites with two different values for each site . They each need to be their own data set and I only have one category for the x axis because I just need the sites to show with two subdata sets stacked. Attached is an example of what I would like, and I think I have the set up correct for the most part....

post-28394-0-49611500-1343321571_thumb.jpg

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

You would need to retrieve and generate XML from database for Multi-series Stacked Column 2D chart.

 

Following is the XML structure for Multi-series Stacked Column 2D chart,

 

<chart ... >

<categories ... >

<category label='1'/>

<category label='2'/>

<category label='3'/>

<category label='4'/>

<category label='5'/>

</categories>

 

<dataset>

<dataSet ... >

<set value='3' />

<set value='4' />

<set value=6' />

<set value='7' />

<set value='4' />

</dataSet>

 

<dataSet ... >

<set value='1' />

<set value='8' />

<set value='9' />

<set value='4' />

<set value='2' />

</dataSet>

</dataset>

 

<dataset>

<dataset ...>

.

.

</dataset>

<dataset ...>

.

.

</dataset>

</dataset>

.

.

.

</chart>

 

You would need to retrieve data and generate XML from database accordingly.

 

Please refer the following URL's for more information:

http://docs.fusionch...StackedCDY.html

 

http://docs.fusionch...SS/MSStCol.html

 

Hope this helps!

Share this post


Link to post
Share on other sites

If I use the xml format, then I don't have to create the fusionchart object correct and I would use the Call renderChart function instead? also if I don't use the FC object can I still renderChart() and have the result be javascript?

Share this post


Link to post
Share on other sites
Guest Sumedh

If I use the xml format, then I don't have to create the fusionchart object correct and I would use the Call renderChart function instead? also if I don't use the FC object can I still renderChart() and have the result be javascript?

 

Hey,

 

If you are rendering charts using FusionCharts ASP Class, then you can use JS embedding method.

 

Here, you will create FusionCharts ASP class object FC. So you would need to call the renderchart function on the FusionCharts ASP Class object "FC".

 

Ref. Code:

Call FC.renderchart(false)

 

Hope this helps!

Share this post


Link to post
Share on other sites

Hey,

 

If you are rendering charts using FusionCharts ASP Class, then you can use JS embedding method.

 

Here, you will create FusionCharts ASP class object FC. So you would need to call the renderchart function on the FusionCharts ASP Class object "FC".

 

Ref. Code:

Call FC.renderchart(false)

 

Hope this helps!

Ok thanks but that is what I have in my code above. I was wondering if I could not use the asp class object and still render in javascript?

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

If you are rendering chart using FusionCharts ASP class method, then you would have to use its object for rendering the chart.

 

You can also use simple ASP method to render the chart, you don't need to create an object here.

 

By calling "renderchart" function, you can render the chart.

 

Please refer the following URL, for more information:

http://docs.fusionch...sicExample.html

 

Hope this helps!

Share this post


Link to post
Share on other sites

Hi,

 

If you are rendering chart using FusionCharts ASP class method, then you would have to use its object for rendering the chart.

 

You can also use simple ASP method to render the chart, you don't need to create an object here.

 

By calling "renderchart" function, you can render the chart.

 

Please refer the following URL, for more information:

http://docs.fusionch...sicExample.html

 

Hope this helps!

so if I use the renderchart("line.swf","","strParam","chart1", 800,800) it will render it in javascript?

Share this post


Link to post
Share on other sites

I am having the same error with my code! I think it might be with how I am adding my dataset... Here is my code

 

<%@ Language=VBScript %>
  <!-- #INCLUDE file="FusionCharts.asp" -->
  <!-- #INCLUDE file="DBConn.asp" -->
  <!--#include file="FusionCharts_Gen.asp"-->





<html  >
<head>
   	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

   	<title>Blood Pressure Chart</title>
   	<link href="../assets/ui/css/style.css" rel="stylesheet" type="text/css" />
   	<script type="text/javascript" src="jquery.min.js"></script>

   	<script LANGUAGE="Javascript" SRC="FusionCharts.js"></SCRIPT>
</head>
<body>
<div class="Blood Pressure">

<%

Dim subjectCode,subjectID,treatmentCode,baseline,count, motherID,x,z
Dim FC,strQuery,Hours(27),strCategory,upper, lower
z=0
hours(0) = ".25"
hours(1) = ".5"
hours(2) = ".75"
hours(3) = "1"
hours(4) = "2"
hours(5) = "3"
hours(6) = "4"
hours(7) = "5"
hours(8) = "6"
hours(9) = "7"
hours(10) = "8"
hours(11) = "9"
hours(12) = "10"
hours(13) = "11"
hours(14) = "12"
hours(15) = "13"
hours(16) = "14"
hours(17) = "15"
hours(18) = "16"
hours(19) = "17"
hours(20) = "18"
hours(21) = "19"
hours(22) = "20"
hours(23) = "21"
hours(24) = "22"
hours(25) = "23"
hours(26) = "24"



subjectCode = Request.QueryString("subjectCode")

Response.Write("Subject Code: " & subjectCode & "<br />")
set FC = new FusionCharts
Set oConn = Server.CreateObject("ADODB.Connection")   
Set oRs = Server.CreateObject("ADODB.Recordset")
Call FC.setChartType("MSCombiDY2D")
Call FC.setSWFPath("../ATACHII/")
Call FC.setSize("800","800")
oConn.Open strConnQuery

strQuery="Select z.ID as totOutput, d.zTreatmentCode as totOutput2 from vSubjectDemographics d, zSubject z where z.zsubjectCode = d.zSubjectCode AND z.zSubjectCode = "&subjectCode&" "'get treatment and subjectID
Set oRs = oConn.Execute(strQuery)
subjectid = oRs("totOutput")
treatmentCode = oRs("totOutput2")

if treatmentCode=1 then'figure out upper/lower bound of BP from treatment
   	upper=140
   	lower=110
else
   	upper=180
   	lower=141
end if


strQuery="Select  ID as mother from F05 where zsubjectID = "&subjectID&" "  'get baseline and motherFormID
set oRs = oConn.Execute(strQuery)
motherID = oRs("mother")

strQuery= "Select count(ID) as totOutput from F05C where MotherRecID = "&motherID&" "'get number of hours assessed
set oRs = oConn.Execute(strQuery)
count = oRs("totOutput")
x=0
strParam = "caption = Blood Pressure with Treatment; PYAxisName =Minimum Systikuc Blood Pressure (mmHg) ;SYAxisName = Maximum Dose of Nicardiphine (mg); xAxisName=Hours"
Call FC.setChartParams(strParam)

'<vLine color='FF5904' Label='First Hour' />"


do while z<=3 
  	if z = 0 then
     	Call FC.addCategory("Baseline","","")  
  	elseif z = 1 then 
  		Call FC.createMSStDataset()
  		Call FC.addMSStSubDataset("Max SBP","parentyAxis = P; renderas=Line")
  		Call FC.addChartData("0","","")
  	elseif z = 2 then 
     	' Call FC.createMSStDataset()
  		Call FC.addMSStSubDataset("Min SBP","parentyAxis = P;renderas=Line")
  		Call FC.addChartData("0","","")
  	else
  		Call FC.addMSLineset("NICARDIPINE","parentyAxis = S;renderas=Line")
  		Call FC.addMSLinesetData("0","","")
  	end if 

  	do while x<count 
		strQuery= "Select QB as Max, QC as Min, QG as Treatment from F05C where OrderNb = "&x+1&" AND MotherRecID = "&motherID&" " ' get max,min,treatment
		set oRs = oConn.Execute(strQuery)

		if z = 0 then
       	Call FC.addCategory(""&hours(x)&"","","")
       	response.Write(x)

       	if x=3 then
      		Call FC.addVTrendLine("startValue=89.5;endValue=98;color=FF0000;displayvalue=Roll. Avg")
       	end if
		elseif z = 1 then 
		response.Write(x)
       	Call FC.addChartData(""&oRs("Max")&"","","")

		elseif z = 2 then 
       	Call FC.addChartData(""&oRs("Min")&"","","")
       	response.Write(x)
		else  
   	Call FC.addMSLinesetData(""&oRs("Treatment")&"","","")
   	response.Write(x)
   	end if 


  	x=x+1
  	Loop
  	response.Write("<br>")
  	x=0
  	z=z+1
Loop
'Call FC.addTrendLine("startvalue= "&upper&"  displayvalue=Upper SBP Bound")
'Call FC.addTrendLine("startvalue= "&lower&"  displayvalue=Lower SBP Bound")


  call FC.SetRenderer( "javascript" ) 
  call FC.renderChart(false)
Set oRs = Nothing

response.Write(strCategory)

oConn.Close
%>

</div>

</body>
</html>

 

I looked up where the error is in the FusionCharts_Gen.asp and this is the part.

Private Function getMultiDataSet()
      Dim partXML, Col, Key, i 
      If seriesType>1 Then
       partXML=""
       ' Fetch dataSet Collections
       set Col=dataSet.getCollections()
       Key=Col.Keys
       for i=0 to Col.count -1 
	       partXML = partXML & "<dataset  " & dataSetParam(Key(i)) & " >" ' THIS LINE IS WHERE THE ERROR IS......
      		response.Write("here")
	       dim Key1, Col1, j
	       set Col1=dataSet(Key(i)).getCollections()
	       Key1= Col1.Keys
	       for j=0 to Col1.count -1 
			       If dataSet(Key(i))(Key1(j)) <> "" Then 
				     ' adding elements 
				     partXML = partXML & dataSet(Key(i))(Key1(j))
			       End If
	       Next
	       partXML = partXML & "</dataset>"
		Next
       ' Return dataset element
       getMultiDataSet = partXML
      End If
    End Function

Edited by Charter

Share this post


Link to post
Share on other sites
Guest Sumedh

so if I use the renderchart("line.swf","","strParam","chart1", 800,800) it will render it in javascript?

 

Hi,

 

For rendering a chart in JavaScript, you would have to call FC_SetRenderer() function.

 

You need to call this function each time before you call renderChart function.

 

Ref. Code:

 

FC_SetRenderer( "javascript" )

Call renderChart("../../FusionCharts/Column2D.swf", "Data/Data.xml", "", "chart1", 600, 300, False, True)

 

 

Share this post


Link to post
Share on other sites

Hi,

 

For rendering a chart in JavaScript, you would have to call FC_SetRenderer() function.

 

You need to call this function each time before you call renderChart function.

 

Ref. Code:

 

FC_SetRenderer( "javascript" )

Call renderChart("../../FusionCharts/Column2D.swf", "Data/Data.xml", "", "chart1", 600, 300, False, True)

 

 

 

Ok so this is the very end of my code

 strCategory = strCategory + "</categories>"
strValueMax = strValueMax + "</dataset>"
strValueMin = strValueMin + "</dataset>"
strValueTreat = strValueTreat + "</dataset> <trendLines> <line startvalue= '"&upper&"' color = '' displayvalue='Upper SBP Bound'/> <line startvalue= '"&lower&"' color = '' displayvalue='Lower SBP Bound'/> </trendLines></chart>"

Call FC_SetRenderer("Javascript")'this is what your telling me I should add
Set oRs = Nothing
strCategory = strCategory + strValueMax + strValueMin + strValueTreat 
response.Write(strCategory)
Call renderChart("MSCombiDY2D.swf","", strCategory,"Blood Pressure",800,600)
oConn.Close

 

Then I get this error

Error Category Microsoft VBScript runtime COM Error Number -2146828275 (0x800A000D) File Name /nett/TestFiles/ATACHII/BPChart.asp Line Number 131 Brief Description Type mismatch: 'FC_SetRenderer'

 

Any suggestions?

Share this post


Link to post
Share on other sites

Error Category Microsoft VBScript runtime COM Error Number -2146828275 (0x800A000D) File Name /nett/TestFiles/ATACHII/BPChart.asp Line Number 131 Brief Description Type mismatch: 'FC_SetRenderer'

 

Any suggestions?

I don't get this error anymore because I am using a different FusionCharts.asp file. Still the screen comes up blank with just a "Chart" text in the middle

Share this post


Link to post
Share on other sites

Hey,

 

Please check the following:

  • You've copied FusionCharts.js, jquery.min.js, FusionCharts.HC.js and FusionCharts.HC.Charts.js in the right folder.
  • You've included and provided the correct path of FusionCharts.js in your HTML code.
  • There are any JavaScript syntax or runtime errors that might have halted the execution of FusionCharts APIs.
  • Unique names are used for the chart's JavaScript variable, chart's ID and the HMTL DIV's ID?

Share this post


Link to post
Share on other sites

Hey,

 

Please check the following:

  • You've copied FusionCharts.js, jquery.min.js, FusionCharts.HC.js and FusionCharts.HC.Charts.js in the right folder.
  • You've included and provided the correct path of FusionCharts.js in your HTML code.
  • There are any JavaScript syntax or runtime errors that might have halted the execution of FusionCharts APIs.
  • Unique names are used for the chart's JavaScript variable, chart's ID and the HMTL DIV's ID?

I double check all of them and they are correct.....:(

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hey,

 

As you are willing to render the "MSCombiDY2D" chart, could you please browse your page in Firefox browser, enable the firebug console and provide the XML generated by your ASP code?

 

It seems, from the code posted on 06 July 2012, you are trying to render "MSStackedColumn2D" chart using FusionCharts ASP Class (FusionCharts_Gen.asp).

 

So, could you please clarify once,

 

1. Which chart type you are using

 

2. Which method you are using for creating chart XML (either using ASP Class FusionCharts_Gen.asp file or simple FusionCharts.asp)

 

3. What is the exact issue, along with the code snippet and the screen shot of your issue

 

Awaiting your valuable inputs.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this