Chapter 9 Accessing objects using VBScript


Manipulating reports using VBScript

You can generate HTML and RTF reports using VBScript, but you cannot create reports.

The main actions you can perform for model reports and multi-model reports are the following:

You can browse a report for a model using the following collection on BaseModelReport: Reports As ObjectCol.

Example

set m = ActiveModel
For each Report in m.Reports
Output Report.name

You can retrieve a multimodel report using the following function: OpenModel( filename As String, flags As Long =omf_Default) As BaseObject

Example

OpenModel ("c:\temp\mmr1.mmr")

You can generate a model report or a multimodel report as HTML using the following method on BaseModelReport: GenerateHTML(ByVal FileName As String) As Boolean.

Example

set m = ActiveModel
For each Report in m.Reports
   Filename = Report.name & ".htm"
   Report.GenerateHTML (filename)
next

You can generate a model report or a multimodel report as RTF using the following method on BaseModelReport: GenerateRTF(ByVal FileName As String) As Boolean

Example

set m = ActiveModel
For each Report in m.Reports
   Filename = Report.name & ".rtf"
   Report.GenerateRTF (filename)
next

 


Copyright (C) 2005. Sybase Inc. All rights reserved.