Scripting Question

Is there a way to have a script run every time a user executes a query with Business Objects? Perhaps there is a way to put a script in the definition of the connection? I’m looking at several uses for such a script including a way to measure the response time. For instance, I would like to keep a log of the time right before the query is sent to the database (Informix) and the time immediately after all the results have been returned to Business Objects. The script would also need to log the SQL that was executed and the Business Objects userid. I would like to do the monitoring at this level, rather than on the DBMS server, since it will show the true end-to-end response time including the network, not just the response time of the DBMS. I’m new to scripting with Business Objects, so any help with this would be greatly appreciated.

Thanks,
Dennis Edgecombe
Washington State University


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

Yes. Create a script named BusObj.spt and save it in your scripts directory.

Create the following subroutine in the BusObj script:

Sub OnBeforeRefreshDocument
'Place code you want here
End Sub

This subroutine will run before any document is refreshed.

Robert

Schmidt Interactive Software, Inc.
We now post Document and ReportScript files on our WEB site!!

Is there a way to have a script run every time a user executes a query with Business Objects? Perhaps there is a way to put a script in the definition of the connection? I’m looking at several uses for such a script including a way to measure the response time. For instance, I would like to keep a log of the time right before the query is sent to the database (Informix) and the time immediately after all the results have been returned to Business Objects. The script would also need to log the SQL that was executed and the Business Objects userid. I would like to do the
monitoring
at this level, rather than on the DBMS server, since it will show the true end-to-end response time including the network, not just the response time of the DBMS. I’m new to scripting with Business Objects, so any help with this would be greatly appreciated.


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

X-cc: Mabey Dave A mabey.da@dreyfus.com

Hello - I am using BO 5.1 with a script to update data providers with date conditions.

This section of VB code adds a date condition to a data provider:

ElseIf intDPnum = 7 Then

boCurrentDP.Queries.Item(1).Conditions.Add “Dates Dreyfus Transaction Summary”, “Month D”, “Between”, Prior2QtrBegin, “Constant”, Prior2QtrEnd, “Constant”

The value I pass from VB for Prior2QtrBegin is 07/01/2000 The value I pass from VB for Prior2QtrEnd is 09/30/2000

The end result for the where clause should be “…WHERE MONTH D BETWEEN 07/01/2000 AND 09/30/2000”.

However, when I view the data provider after the code was executed, the value for Prior2QtrBegin does not
get updated correctly (07/02/2000 gets converted to 1/20/0007 12:00:00 AM). The other date is passed correctly.

Why would the ending date get updated correctly, but the begin date get corrupted?
This happens with the other data providers that require a “between” condition.

Data providers that are updated with a single date condition (such as “where date = …”) do not encounter this problem.

Any help you can give me would be great.

Thanks,
Daniel Keller, Software Engineer:
Mellon Bank, Pittsburgh, PA
Consumer Management Systems
412-234-1124

***************************************************************** DISCLAIMER: The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.


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

I have one report that includes 2 queries. Query 1 from Universe 1, and Query 2 from Universe 2. I have a script that I can populate conditions into Query 1, but I also need to populate similar conditions into Query 2 at the same time. I’m not having any problem populating both sets of conditions into Query 1, but I really need the Query 2 conditions to go to Query 2. I’ve stretched my scripting abilities as far as I can, but they will not quite reach the answer to this one.

I’m sure that I need to do something else to set Query 2, but as I’m very dumb when it comes to scripting, I’m at a loss. Any help would be greatly appreciated!! Thanks!!

Dim myQuery As busobj.Query
Set myDP = myDoc.DataProviders.Item(1)
Set myQuery = myDP.Queries.Item(1)
myDP.Load


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

In a message dated 01-12-10 16:59:04 EST, you write:

I’m sure that I need to do something else to set Query 2, but as I’m very
dumb when it comes to scripting, I’m at a loss. Any help would be greatly appreciated!! Thanks!!

Dim myQuery As busobj.Query
Set myDP = myDoc.DataProviders.Item(1)
Set myQuery = myDP.Queries.Item(1)
myDP.Load

To reach the second query, change this line:

Set myDP = myDoc.DataProviders.Item(1)

to this:

Set myDP = myDoc.DataProviders.Item(2)

The item “DataProviders” is what is known as a collection. You can reference each / any of the items (individual data providers in this case) by using the appropriate subscript. You can even try:

For i = 1 to myDoc.DataProviders.Count

do your stuff here

next i

… to loop through each available data provider, assuming that you don’t know how many there are in the document. Hope this helps you get started… :slight_smile:

Regards,
Dave Rathbun
Integra Solutions
www.islink.com


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