SCRIPTING

Environment:

SQL Server on NT4

I have 50+ printers installed on my NT machine. I have my personal one set up as the default printer (NT/Win95 requires a default). I have documents that execute the following script:

Sub Main()

Dim doc as BODocument

set doc = Application.Documents.Item(1)

doc.Refresh
doc.PrintOut("\server1\printer1")
doc.PrintOut("\server2\printer2")
doc.PrintOut("\server3\printer3")
doc.PrintOut("\server4\printer4")
doc.Save
doc.Close

End Sub

This is what is actually occurring (in this example) when (A) I execute the script with the report open AND (B) I attach the script to a report and schedule it on the DocAgent: (1) It opens the document correctly, refreshes the document and report values correctly, but then (2) It first prints out to the MACHINE’s default printer (not any of the printers specified in the script), (3) It then prints out to server2\printer2, (4) then prints to server3\printer3, (5) saves the document, (6) closes the document. When run manually, I can see this occurring. When the DocAgent runs it itself, it reacts exactly the same, however the log indicates a successful job…HARDLY!

This is one example. I have other documents that print to over 50+ printers…is anyone else experiencing this problem, know of any solutions!!!

HELP!!!???

Tim


Tim K Heuer
PacifiCare Health Systems
(714) 825-5702 - office
(800) 946-4645 pin 1404017 - pager
heuer_tk@exchange.phs.com


Listserv Archives (BOB member since 2002-06-25)

Tim,

Have you tried this with more printers to see if it is indeed just skipping the first and last print job, or is it something more? Depending on the length of time it takes to send the report to the printer, you may be running into a timing issue.

Perhaps setting a short delay between Printouts would give the application a chance to resolve the printer names and send the document. It may even be an issue with the number of concurrent tasks that can run. Without a little testing I can’t say for sure.

Let me know if a test with more printjobs created a similar ‘skipping’. I’d be interested to know. Thanks.

-rm

Dim doc as BODocument

set doc = Application.Documents.Item(1)

doc.Refresh
doc.PrintOut(“\server1\printer1”)
doc.PrintOut(“\server2\printer2”)
doc.PrintOut(“\server3\printer3”)
doc.PrintOut(“\server4\printer4”)
doc.Save
doc.Close


Listserv Archives (BOB member since 2002-06-25)

X-cc: “digpen@earthlink.netdigpen@earthlink.net

This does have the same situation with fewer or more printers…how would you suggest I add a pause in the script?


Listserv Archives (BOB member since 2002-06-25)

Tim, Try this script:

‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ ’ This routine defines a timer during which the ’ execution will pause.

‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ Sub Pause
PauseTime = 15 ’ Set duration.
Start = Timer ’ Set start time.
Do While Timer < Start + PauseTime
DoEvents ’ Yield to other processes.
Loop
Finish = Timer ’ Set end time.
TotalTime = Finish - Start ’ Calculate total time. ’ Do not print a dialog box, just here to help people to understand… ’ MsgBox “Paused for " & TotalTime & " seconds” End sub

Best regards,

Crystal Golding
Senior Systems Analyst
Management Information Section
University of Queensland
Brisbane Australia 4072
E-mail: c.golding@mailbox.uq.edu.au
Phone: +61 7 336 57289
Fax: +61 7 336 58202


Listserv Archives (BOB member since 2002-06-25)

I am trying to run a BusinessObjects script for logging user activity from the central script directory on our server. However BO scripts only seem to work from a directory where the user can write and does not work from directories that are read-only. The output is written to a directory where the user does have write access.

Can anybody explain why the script won’t run from a read-ony directory?

regards,

Desiree Schipper


Listserv Archives (BOB member since 2002-06-25)

Desiree wrote:

I am trying to run a BusinessObjects script for logging user activity from the central script directory on our server. However BO scripts only seem to work from a directory where the user can write and does not work from directories that are read-only. The output is written to a directory where the user does have write access.
Can anybody explain why the script won’t run from a read-ony directory? ------------------------------------------------------------------------- When you run a script the first time it needs to compile. If you look in your script directory you will see and .spt and a .sbx file for each of your scripts. The spt file is what you edit in Report Script, this is just a text file, so you could edit it in notepad etc. The sbx file is the compiled version. This is why they need write access to the directory, because if the sbx file isn’t there it will be created the first time it is run. So one way around your problem is to place the sbx file in the same directory.

Glenn Fredericks
Data Warehouse Specialist
glenn_fredericks@aal.org
(920) 730-4700 x4236 or 1-800 CALL AAL

Aid Association for Lutherans
4321 N. Ballard Road
Appleton, WI 54919-0001
Visit our Web site at www.aal.org or e-mail us at aalmail@aal.org

AAL… Financial services. Lutheran heritage. A powerful combination.


Listserv Archives (BOB member since 2002-06-25)

I’m just beginning to look at the Bus. Obj. scripting and the ReportScript Basic Language Guide says to refer to the Scripting Guide. I looked in the set of manuals but do not see that. Can someone tell me where I’d find this?

Shannon Lee Wittal swittal@qgraph.com

Listserv Archives (BOB member since 2002-06-25)

Shannon wrote:
says to refer to the Scripting Guide. I looked in the set of manuals but do not see that. Can someone tell me where I’d find this?

If you are working with V4.1.x, it probably refers to the Developer’s Guide which discusses OLE Automation with BO. It should be in your manual set. If it is not contact your BO account rep.


Listserv Archives (BOB member since 2002-06-25)

There is a separate book titled Scripting guide for Windows (at least for version 4.0). Your Bus Obj salesperson should be able to obtain it for you. It is not the same as the Developer’s Guide. Roger Poole
rpoole@nswc.navy.mil

Shannon wrote:
says to refer to the Scripting Guide. I looked in the set of manuals
but do not see that. Can someone tell me where I’d find this? If you are working with V4.1.x, it probably refers to the Developer’s Guide which discusses OLE Automation with BO. It should be in your manual set. If it is not contact your BO account rep.


Listserv Archives (BOB member since 2002-06-25)

rpoole wrote:

There is a separate book titled Scripting guide for Windows (at least for version 4.0).


Brent D. Houk
Business Objects Coordinator
Eli Lilly & Co.
(317) 433-1911
bhouk@lilly.com


Listserv Archives (BOB member since 2002-06-25)