Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running BO reports from command line.. 1

Status
Not open for further replies.

harryx

Programmer
May 17, 2001
5
GB
I've got a requirement to call call a BO reports from Oracle Forms. Basically the form needs to set up some parameters, call BO using the command line, run and print the report in background and return to forms.

As I'm new to BO so far I've managed to call and run the report from the command line, but I'm struggling with automatically printing and exiting.

Any ideas ? ::)
 
You didn't say what version of BusinessObjects you're using but you'd have to do this with a script. f it's v4 then you need to use '-script' and with v5 you'll need to embed the script (VBA) into the report.

Not sure of the VBA syntax but it's pretty straight forward and the v4 script can be created by recording a macro.

Sorry, no time to eleborate.
 
Embed the actual report with a script?

Script Example: How to Open, Refresh, Export to Microsoft Excel and then Close.

Note: The following example is based on the Annual report included with the BusinessObjects CDROM and installed by the Demonstration option.

sub main
Application.Documents.Open("Annual")
Application.Documents.Item("Annual").Refresh

dim dp as BODataProvider
set dp = ActiveDocument.DataProviders.Item(1)
call dp.ConvertTo(ExpExcel,0,"XLS")
Application.Documents.Item("Annual").Close

end sub
----------------
Some more info i found about the printing script:

Generate a script and use the method PrintOut(&quot;\\<Server_Name>\<Printer_Name> &quot;) or PrintOut(&quot;<Printer_Name>&quot;) of the class BODocument.

Example of Script (for Windows NT)

Sub Main
ActiveDocument.PrintOut(&quot;Printer17&quot;)
End Sub

---Or (including the path name)

Sub Main
ActiveDocument.PrintOut(&quot;\\OurServer\Printer17&quot;)
End Sub
 
I created a script to refresh a number of reports and save them, this works well until i get an error with one of the reports reading 'no data to fetch' this is fine but it stops the rest of my script running until i click ok. How can i supress these errors and keep my script running?
 
Hi Alexmi,

Sorry I dont have an answer for you, but i have a similar requirement if you have any answer let me know.

I need to create a script to refresh all my reports and export them as pdf files. Is there any way to automate this process without using BCA.
How are you Refreshing all your reports. If you have any code pl.. send it across.
 
Tips for non-interactive Business Objects automation with VBA:

1) Switch off interactive mode:
[tt]
busobj.Application.Interactive = false
busobj.Application.BreakOnVBAError = false
[/tt]
2) Catch errors properly with [tt]On Error[tt]
 
Hi Vemulapalli,

I am having the same requirement. If u work out with this requirement, culd u please send me the code.

Thanks,
Shyam.
 
Hi, I am running 8 BO reports via VBA from Access and would like them to refresh at the same time. Up to now, they only refresh one after another. What can I do? Would it be a good idea to start BO from shell? What is needed to make BO start from shell with a specific report?
Thanks a lot!
 
murid,

To launch BO from the Cmd Line the brief syntax is

busobj -user user1 -pass user1pass -keyfile keyfilename reportname

Even with this approach there will be a time delay as you will have 8 BO instance opening one after the other and the reports should refresh one by one with a time difference. Now the VBA code needs to be in each report for save once the report is refreshed or package it as a Add-In.

My personal feeling all these are not really worth.

Sri
 
Sri,

thank you for you help. But what does &quot;keyfile&quot; stand for? I assumed it to be the &quot;*.rep&quot; file with its path and got the following message: &quot;The key file name given in the command line does not exist in the data folder. (USR0061)&quot;.

Murid
 
It's the BOMain.key or whatever you named it .key (of course the one related to the correct repository)

Stick to your guns
 
Thank you very much PabloJ! Now I get BO running from command line, but still it doesn't open the report I have specified right after the keyfilename (as suggested by Sri with &quot;busobj -user user1 -pass user1pass -keyfile keyfilename reportname&quot;). What do I have to do?
 
Does the report exists in the current directory? If not you might have to specify the full path name. If it doesn't open are you getting any error message.

Sri
 
The method works for reports stored locally, not to retrieve documents from repository.
Note that if you have BO SDK you can write some visual basic program (.exe) that does whatever you want and can be scheduled with standard windows tools.

Stick to your guns
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top