Running BO Reports from a VB v6.0 and/or VB .NET Appication

Can we call/run BO Reports from a Visual Basic v6.0 and/or Visual Basic .NET application ?

Does Business Objects provides/exposes APIs/webservices/etc so an ‘external’ application can communicate/run BO reports ?.

Basically we wanto to create our on application in which one of the functionality will be to call/run BO Reports that has already been created.


JBardales :us: (BOB member since 2005-04-12)

Short answer is yes. The long answer depends on version, possibly licensing, what reporting tool, and your requirements.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

We are using Business Objects v6.5.1; currently using/publishing full-client reports into infoview/WEBI v6.5.1.

This is running on WinTel WEB server with Windows Server 2003 SP3 and the BO Repository is on a SQL 2000 Server.

We have today a Visual Baisc .NET application that runs constantly performing some data audit controls (basically to verify if the ETL tools is working properly or if an error has occured :!: ). If there is an error or incomplete data (as per our definition of that :wink: ) this VB.NET application sends an alert email to the proper support team.

This is been done basically by running some SQL Queries and converting the resultset into HTML and send it via email.

What we are looking for is to have that VB.NET application run some data-audit reports (develop on BO full-client) and send the results via email to the support-team (if possible as a PDF attachment); the full-client reports (.REP) can be saved on the same folder of the VB.NET application :idea: .

Will the the box running the VB.NET application need to have BO-Report installed ? and can it loging into BO-Reporter and run the reports unattended ?

We do have 1 license for BroadCast Agent v6.5.1, but haven’t use it yet :frowning: . Also it is our understanding that BCA will not ‘email’ the reports (it will send them to a BO user’s inbox instead :hb: ).
Although I have read somewere before that via VBA/SDK code it is possible (if we only had more hours during the day :cry: )

Didn’t thought about licensing (yet), but I hope we can use a single name-user license for this monitoring application.

Please advise. Thanks for your help :!:


JBardales :us: (BOB member since 2005-04-12)

This VBA Code will Open a report, Refresh it and Save refreshed copy as XLS. Most of it is plagiarized form other posts in this forum :wink:

Dim boDoc As busobj.Document
Dim bo As busobj.Application

Dim FilePath, ReportName, RepoName, PartFileName As String

Path = "C:\Program Files\My Business Objects Documents\userDocs\"
SavePath = "C:\location to save files\"
Usrnm = "user"
Pswrd = "password"
RepoName = "BOMAIN"
ReportName = "testBORep"



Set bo = CreateObject("BusinessObjects.Application")
bo.LoginAs Usrnm, Pswrd, False, RepoName


Set boDoc = bo.Documents.Open(Path & ReportName & ".rpt", True, False)

Dim promptName, promptValue As String

promptName = "Select Year"
promptValue = "2006"

boDoc.Variables.Item(promptName).Value = promptValue

bo.Application.Interactive = False
boDoc.Refresh

boDoc.SaveAs SavePath & ReportName & ".xls"

boDoc.Close
bo.Quit

You will need to install BO on the machine that is trying to run this code.

You can easily convert it to mail the report instead of saving it. And then you can save this as VBS script. This script can be scheduled to run from Windows Task Scheduler.


shamit (BOB member since 2004-07-01)

Shamit, This is exactly what I was looking for. Thank you very much.


JBardales :us: (BOB member since 2005-04-12)

hi shamit

First thanks for the code!!

i have a problem when run you code on (Vbs). i receive this message:

OUTPUT
C:\Documents and Settings\Administrator.SERVER\Application Data\Adersoft\VbsEdit\Temp\JGESGTSO.vbs

(1, 11) Microsoft VBScript compilation error: Expected end of statement

the output say me than the error is on line 1 char 11

anyone has a idea


acorrea (BOB member since 2006-03-22)

Does it run fine on that machine as VBA code?

Try embedding this code in some Excel event… does it work?


shamit (BOB member since 2004-07-01)

Hi my friend

already try embeddiExcel event . don’t wokt too. i receive the following compile error : User-Defined type not defined. this at the first line.

i try run the code in other machine and always receive the same error.

Thanks a lot!!


acorrea (BOB member since 2006-03-22)

Have you imported Business Objects type library into Excel VBA?

That seems a like reason for this error.


shamit (BOB member since 2004-07-01)

thanks shamit, You are right!! the problem was the references!!
Thanks a lot my friend!!!.


acorrea (BOB member since 2006-03-22)