p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_discuss thread: Using JavaScript & VBScript together


Message #1 by "Sukhoi" <sukhi_soodan@y...> on Mon, 1 Oct 2001 22:53:55
Hi Hema,

   I am trying to solve this problem for some time,but have not got any

break through,any help would be appreciated.The Problem is as described

below.

         Its a main structure of the  page i.e tables were constructed in 

javascript,& their r few functions which i have developed in 

javascript,which i am using in it.Recently i was able to solve a 

problem,of showing crstal reports on web,using CRViewer an ActiveX Control 

of SeaGates Crystal reports 7.Now i want to add this ctiveX control in 

this page.The Working of the page is as such,that when i click on to the 

button it flip open's the activeX window,& when i click it again,it 

closes.So When i integrated this ActiveX control with it.It doesn't show 

me Crystal report in it,while it show only blank ActiveX Component.

                             When i Execute it shows error As Follows

" Line:1,Object Doesn't Support This Property Or Method".Which points to 

this line in the code ie.



<BODY  background="C:\sukhi\Project1\Clear Day Bkgrd.jpg" 

onload="Page_Initialize">



          Kindly help me to bug out the problem.The whole code of the 

Program is as follows

................................



<html>

<BODY  background="C:\sukhi\Project1\Clear Day Bkgrd.jpg" 

onload="Page_Initialize">

<head>

<title>ABM Machine Profile</title>

</head>



<SCRIPT language=javascript >

<!--

  function OpenIt(sID) {

	var rs;

	

	if (document.all(sID).style.display == "") 

	//Handle Hiding the sub menus

	{

	       

		document.all(sID).style.display = "none";

		event.srcElement.setAttribute("src","go[2].gif");

		rs = "|" + sID + "|";

		openmenus = openmenus.replace(rs,"");

	

	}

	else

	//Handle Showing the sub menus

	{

	   

	    document.all(sID).style.display = "";

		event.srcElement.setAttribute("src","gobutton1[1].gif");

		rs = "|" + sID + "|";

		var x = openmenus.indexOf(rs,0);

		if (x == -1) 

		{

			openmenus = openmenus + "|" + sID + "|";

		}	

	}

}



var openmenus;

openmenus="";

function goToPage(url,sType) {

//window.open(url,"IDEASLinks");

 document.frmReports.type.value  = sType

 document.frmReports.action = "server_page1.asp"

 document.frmReports.submit();

}

-->

</SCRIPT>



<script language=vbscript>

<!--

Sub Page_Initialize

strHref=window.location.href

	         strval=split(strHref,"/",-1,1)

	         strWebPath=strval(2)& "/" & strval(3) 

& "/ssdaily_graph.rpt"  



	On Error Resume Next

	Dim webBroker

	Set webBroker = CreateObject("WebReportBroker.WebReportBroker")

		if ScriptEngineMajorVersion < 2 then

		window.alert "IE 3.02 users on NT4 need to get the latest 

version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need 

DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files 

are available at Microsoft's web site."

		CRViewer.ReportName = Location.Protocol + "//" + strWebPath

	else

		Dim webSource

		Set webSource = CreateObject

("WebReportSource.WebReportSource")

		webSource.ReportSource = webBroker

		webSource.URL = Location.Protocol + "//" + strWebPath

		webSource.PromptOnRefresh = True

		CRViewer.ReportSource = webSource

	end if

	CRViewer.ViewReport

End Sub

-->

</script>

<TABLE class='ideas' border=0 cellPadding=0 cellSpacing=0>

  <TBODY>

  <TR>

  <TD vAlign=top width="100%">

  



 <FORM  METHOD="post"  name = "frmReports" >

<table  WIDTH="100%">

	<tr >

	  <td>

	  <h1><marquee behavior=alternate><FONT face=serif SIZE=7 

color=steelblue align=center><u bgcolor=steelblue>ABM Terminal 

Profile</u></font></marquee></h1><br>

	  </tD>	

	</tr>

</table>



<TABLE id = "tab2"  CELLPADDING=1  width="100%"  Height=50% cellspacing=0 >

  	  <TR id="Main_1" >

		   <TD ALIGN = LEFT width="1%" height=10%>

		     <IMG onclick = "javascript:OpenIt('1')" ID = "IMG_1" 

src="go[2].gif" title="Press Button To Get Terminal Information" 

onmouseover="window.status ='Display Terminal Information'" 

onmouseout="window.status =''" style=" CURSOR:hand;">

		   </TD>

		   <TD ALIGN = LEFT ><FONT COLOR = steelblue  

onmouseover="style.color='blue'" onmouseout="style.color='steelblue'" 

title="Press Button To Get Terminal Information">

		      <A onclick = "javascript:OpenIt('1')" 

onmouseover="window.status ='Display Terminal Information'" 

onmouseout="window.status =''" style=" CURSOR:w-resize;" ><b><Font 

size=6><u bgcolor=steelblue>Terminal Information</u></b></A>

		  </TD>

	

	  </TR>

	   <TR id="1" Style="Display:" onmouseover="window.status ='ABM 

Profile Report'" onmouseout="window.status ='' ">

<TD ALIGN = "LEFT" Height=10% WIDTH = 9%></TD>

<TD ALIGN = LEFT>





<OBJECT ID="CRViewer"

 CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"

 WIDTH=700 HEIGHT=500

 codebase="/viewer/activeXViewer/activexviewer.cab#Version=7,0,100,52">

<PARAM NAME="EnableRefreshButton" VALUE=1>

<PARAM NAME="EnableGroupTree" VALUE=0>

<PARAM NAME="DisplayGroupTree" VALUE=0>

<PARAM NAME="DisplayToolbar" VALUE=1>

<PARAM NAME="EnableNavigationControls" VALUE=0>

<PARAM NAME="EnableStopButton" VALUE=0>

<PARAM NAME="EnableCloseButton" VALUE=0>

<PARAM NAME="EnableProgressControl" VALUE=0>

<PARAM NAME="EnableSelectExpertButton" VALUE=0>

<PARAM NAME="EnablePrintButton" VALUE=0>

<PARAM NAME="EnableExportButton" VALUE=0>

<PARAM NAME="EnableDrillDown" VALUE=0>

<PARAM NAME="EnableSearchControl" VALUE=0>

<PARAM NAME="EnableAnimationControl" VALUE=1>

<PARAM NAME="EnableZoomControl" VALUE=0>

</OBJECT>

</TD>

</TR>

</TABLE>

<INPUT type="hidden" name="allNodes" value="1,2"> 

</TD></TR></TBODY></TABLE>

</body>

</FORM>

</html>





...................................

Regards

      
Message #2 by "Milan Shetty" <milanshetty@h...> on Wed, 03 Oct 2001 14:35:27 +1000
Sukhoi,



 If your page's default language is VBScript do not use your vbscript within the script block



<Script Language=vbscript>



 



</script>



Thank You and Regards

Milan Shetty

Message #3 by "Sukhoi" <sukhi_soodan@y...> on Wed, 3 Oct 2001 21:03:59
Hi Milan,

         As for as the vbscript part is concerned,its fine & running the 

ActiveXcontrol with the crystal reports,when i run it independently in 

other web page.Only when i add this section with the javascript 

structure,it doesn't shows up the report.My javascript structure create's 

a text,such that if u click the text it flip opens the ActiveX control box 

in which i want to show Crystal report.It only show's the empty 

ActivevXControl.I am trying to figure out the problem for quite 

sometime,but have no success.Any help will be appriciated.

regards




  Return to Index