VB Script automation sample

Script samples demonstrate the way to use the the TARGET Reports component from multiple scripting environments. You can:

- create a simple .vbs file and run it with cscript.exe or wscript.exe.

- create a simple web page with your own user interface and use JavaScript to drive the report generation process.

- use TARGET Reports as a server component for your web application and automate it from an ASP or ASP.NET page.

The following VBScript illustrates how to open an existing project, modify a scope for one of the reporting elements and show the report in a web browser:

Dim rm, rs, scope, path
Set rm = CreateObject( "ReportManager.ReportManager.1" )
path = rm.GetStartPath()
rm.OpenProject( path & "Samples/TARGET Reports/1.1 Summary.report" )
Set rs = rm.GetRSetup( "Report_1" )
Set scope = rs.GetScope()
scope.Modify "OrderDate>'01/01/1998'", 1, true
rm.SetViewer "HTML"
rm.Run true

...and a simple script that just opens a project:

Dim rm
Set rm = CreateObject( "ReportManager.ReportManager.1" )
rm.OpenProject( "C:\data\Test.report" )
rm.Run( true )