VB script to open a Business Objects report

15 pts.
Business Objects
Hello, I would like to know how I can write a windows script to open a Business Object report. So far, I have gotten it to open up the Business Object application, but does not want to open up the report. This is what I have so far. It works until you get to the Getfile. Any help would be appreciated. Dim F Set objbo = CreateObject("WScript.Shell") set anobj = CreateObject("Scripting.FileSystemObject") objbo.Exec ("C:Program FilesBusiness ObjectsBusinessObjects Enterprise 6binbusobj.exe") WScript.Sleep 5500 objbo.SendKeys"xxxxxx" objbo.SendKeys"{ENTER}" f = anobj.Getfile("\Rmregfile002userse716666Business ObjectsprgHospitalClaim.rep")

Answer Wiki

Thanks. We'll let you know when a new response is added.

This code works for me :

Sub GetBOData()
Dim BoApp As busobj.Application, BODoc As busobj.Document, BORep As busobj.Report
Dim i As Integer

Set BoApp = CreateObject(“BusinessObjects.application”)
With BoApp
.LoginAs “jjacob”, “jerry”
.Visible = True
.Documents.Open (“C:\\Jerry\Desktop\ABC Upload\ABC Trends.rep”)
With .ActiveDocument
i = 1
For Each rpt In .Reports

ActiveSheet.PasteSpecial Format:=”Text”, Link:=False, DisplayAsIcon:= _

i = i + 1
End With
End With

Set BoApp = Nothing
Set BODoc = Nothing

End Sub

Discuss This Question: 4  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Jerry Lees
    Be sure and check out my blog here on ITKE for more Network administration and VBSCRIPT tips. The VBScript Network and Systems Administrator's Cafe
    5,335 pointsBadges:
  • Suncawy
    Thank you for the response. Business Objects also owns Crystal Reports, I'm not sure if your familiar with Crystal, but they are both owned by the same company. It's hard to describe Business Objects other than saying its a Business Intelligence application. It has both a desktop version and what they call a "webi" version (web application). Anyways, to get into the application (desktop or webi) you must supply a username and password, which is why I had the send keys in there. Its my intent to have the application be up and running first. Then have the .rep file be opened. To make a comparison, let's say I want to automate a task of opening a specific microsoft excel file (workbook), I would want to have the microsoft excel application up and running then get the specific excel workbook that you need to have open, which is what I'm trying to get this vb script to do. The thing about excel is that you don't need to provide a password and username to open excel as an application. I tried replacing the exec path to the specific file, but it does not work because the application of Business Objects is not running. Even if Business Objects was running, it would not execute. Anything else that I should try ? Thanks.
    15 pointsBadges:
  • Saravanainfo
    Hi, Thanks for the code... I tried this, it executes sucessfully but doesn't open the BO application or BO report... Any Suggestions Thanks Saravana
    10 pointsBadges:
  • joeywatson
    I think that generally the problem is that you aren't in the proper directory to find the .prg file you need. Often this is because your development environment has set the path to include all the subdirectories you need but when you run the program directly the path hasn't been set.

    I know run a 'dave.prg' program to set the paths and then call the FoxPro projectI'm working on.  You might want to do the same thing for your application. Or as ClayTech suggested, just put it in the form directly either in the init (or whatever) or in a separate user-defined method or property.  The major problem with this way of doing things is that it can't be easily changed for different users if they have different set-ups. Having a separate file makes it easier to modify.
    1,250 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: