DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

running VBS from a web page

Hi,
 
I am working on a project and I already have the reports created and populated from a Mysql Db using a VBS.
 
The question(s)  are:
 
1. How to start the DIAdem VBS  script form an HTML page.?
2. also how to pass a parameter to this script.?
 
The scripts  opens a  dialog window with  dropdown boxes.
When the script is loaded, the passed parameter will be used in a SQL query, which filters the items in the DDown box
 
 
thx
 
0 Kudos
Message 1 of 7
(6,462 Views)
Hello Mikey!
 
Assuming you DIAdem is already running I would recommend to use an OLE interface. The only problem might be the security restrictions of your web page. Try this HTML page (the Query parameter will be in the DIAdem variable T1):
 <html>
  <head>
  <title>Start DIAdem</title>
 
  <script TYPE="text/vbscript" LANGUAGE="vbscript">
   Sub DoDIAdem
     Dim oDIAdem
   
     Set oDIAdem = CreateObject("DIAdem.ToCommand" )
   
     Call oDIAdem.TextvarSet("T1","MyQuery" )
     Call oDIAdem.CmdExecuteASync("ScriptStart('MyQuery.vbs')" )
    End Sub
  </script>
 
  </head>
 
  <body>
  <h1><a href="javascript&colon;DoDIAdem()">Start DIAdem Script...</a></h1>
  </body>
</html>
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 7
(6,448 Views)
Hello Mikey!
 
Assuming you DIAdem is already running I would recommend to use an OLE interface. The only problem might be the security restrictions of your web page. Try this HTML page (the Query parameter will be in the DIAdem variable T1):
 <html>
  <head>
  <title>Start DIAdem</title>
 
  <script TYPE="text/vbscript" LANGUAGE="vbscript">
   Sub DoDIAdem
     Dim oDIAdem
   
     Set oDIAdem = CreateObject("DIAdem.ToCommand" )
   
     Call oDIAdem.TextvarSet("T1","MyQuery" )
     Call oDIAdem.CmdExecuteASync("ScriptStart('MyQuery.vbs')" )
    End Sub
  </script>
 
  </head>
 
  <body>
  <h1><a href="javascript&colon;DoDIAdem()">Start DIAdem Script...</a></h1>
  </body>
</html>
Matthias


Matthias ,

This did work thank you, now i am faced with another chalange, the Dialog window doesn't work thru a web interface, and this forced me to use a different aproache.

Instead of the Dialog window, I created a HTML file/vbscript, which does exactly waht the DIAdem Dialog window was suppose to do.

In this HTML file I have Few drop_down lists that get populated from a MYSql database,  when I perfom the selection one parameter is created for each of these Drop down boxes.

The Question is how to pass these parameters to the DIAdem VBscript? as T1, T2, T3 etc...

thx

 

 

0 Kudos
Message 3 of 7
(6,312 Views)

Hello Mikey!

Did the TextVarSet command not work?

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 4 of 7
(6,300 Views)

Hello Mikey!

Did the TextVarSet command not work?

Matthias

 

Can i use this command to pass multiple parameters?

 

Thx

0 Kudos
Message 5 of 7
(6,297 Views)

Actually, I just tried  the following and it worked:

      Call oDIAdem.TextvarSet("T1","Value1" )
      Call oDIAdem.TextvarSet("T2","Value2" )
      Call oDIAdem.TextvarSet("T3","Value3" )
     Call oDIAdem.CmdExecuteASync("ScriptStart(DiademReport.VBS')" )

 

Thx Matthias

0 Kudos
Message 6 of 7
(6,294 Views)
Good job! Thats the way Smiley Happy
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 7 of 7
(6,289 Views)