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


         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" 


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

Program is as follows



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



<title>ABM Machine Profile</title>


<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";


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

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




	//Handle Showing the sub menus



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


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

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

		if (x == -1) 


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




var openmenus;


function goToPage(url,sType) {


 document.frmReports.type.value  = sType

 document.frmReports.action = "server_page1.asp"





<script language=vbscript>


Sub Page_Initialize



	         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


		Dim webSource

		Set webSource = CreateObject


		webSource.ReportSource = webBroker

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

		webSource.PromptOnRefresh = True

		CRViewer.ReportSource = webSource

	end if


End Sub



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



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


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

<table  WIDTH="100%">

	<tr >


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

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





<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 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>




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

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

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






<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>





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







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

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

<Script Language=vbscript>



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.


  Return to Index