BusinessObjects Board

Shifting DP's in Thick Client Report 6.5

Hi All,

I have already created thick client report in 6.5 which is using 5 DP’s (dp1, dp2, dp3, dp4, dp5). Its a complex report.

When i refresh full report dp’s are executed in the way they are created.

ie: dp1, dp2, dp3, dp4 and dp5.

Now i have to create one more DP called as (Main DP) and assign it to run first when i refresh whole report. But when i view in Data Manager Main DP is created after dp5 and therefore SQL query generated by that dp runs after dp5.

I am getting wierd results due to that.

In WEBI we can shift DP’s (either Left or Right).

How to do this in Thick Client Report.

Awaiting your replies.

Thanks,
Aditya Paranjape


adityapar :us: (BOB member since 2005-12-21)

The equivalent function is not available in full client. You can control the order of execution with VBA code, but not as a generic functionality.


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

Hi,

to change the order of the DPs in the thick (full) BO client is not possible.

You can either:

  1. create your report again with the desired order of the DPs. To make it a little bit easier you can use this add-in: (Copy Data Providers / Copy Report Variables)
    that enables to copy DP from one report to another

or

  1. write your own piece of VBA that will run the DPs in the order you specify.

Marek Chladny :slovakia: (BOB member since 2003-11-27)

Hi all,

Can anyone assist me as to how to write VB Macro. Atleast can you give me starting point.

Please …

Thanks,
Aditya Paranjape


adityapar :us: (BOB member since 2005-12-21)

Hi,

the most simple code for what you need can look like this:


Public Sub Refresh_PDs_in_custom_order()
    ActiveDocument.DataProviders.Item("DP3 name").Refresh
    ActiveDocument.DataProviders.Item("DP1 name").Refresh
    ActiveDocument.DataProviders.Item("DP2 name").Refresh
End Sub

Put this code into ThisDocument part. Change the names of the dataproviders (DP1 name, DP2 name, DP3 name) according to your situation. Run the macro. You are done 8)


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Hi,

I have set open on Refresh Property on thick client report.

I want to run “Main DP” first whenever i run open the report and also when ever i refresh full report.

Main DP is the last dp in Data Manager.

I tried but i am getting “object error not set in WITH Block” Error 91

Can you help me out.

Thanks,
Aditya Paranjape


adityapar :us: (BOB member since 2005-12-21)

Hi,

please post your real VBA code that you use.


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Moving to the SDK Forum.


Dave Rathbun :us: (BOB member since 2002-06-06)

Below is the code:

Private Sub Document_BeforeRefresh(Cancel As Boolean)
MsgBox “Refresh”
ActiveDocument.DataProviders.Item(“Region DP”).Refresh
ActiveDocument.DataProviders.Item(“Report DP”).Refresh
End Sub

Private Sub Document_Open()
MsgBox “open”
End Sub

Here, “Region DP” is the 2nd DP created and i want it to run first.

Also I have set open on Refresh property for Thick Client Report.

I am getting error
“Object Variable or With block Variable not set”
Run Time Error ‘91’:

HELP…

Thanks,
Aditya PAranjape


adityapar :us: (BOB member since 2005-12-21)

Hi,

try this code:


Private Sub Document_Open()
  MsgBox "doc open"
  Call Refresh_DP_in_custom_order
End Sub

Private Sub Refresh_DP_in_custom_order()
  MsgBox "Refresh Start"
  Application.Documents.Item("report_name").DataProviders.Item("Region DP").Refresh
  Application.Documents.Item("report_name").DataProviders.Item("Report DP").Refresh
  MsgBox "Refresh Finish"
End Sub

Change report_name to the real name of your report.


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Hi ,

Your code works. Thanks.

But when i run the report through WEBI (Infoview) VB code doesn’t get executed.

I have added following code

" Call Refresh_DP_in_custom_order "

in Before Refresh Event of the document.

Hence whenever i run the report through Reporter it runs fine

When I click URL of this report in Infoview (due to refresh on open property of the report), VB macro doesn’t run for the first time. whe again executed it runs properly.

Is there any other way to to trigger VB macro in Infoview.

Thanks,
Aditya Paranjape


adityapar :us: (BOB member since 2005-12-21)

Hi,

VBA only works in the BO full-client reports. It can not be used in Infoview. That’s normal behaviour of Infoview. You would probably need to use Webi SDK (Java or ASP) to have the similar functionality in Infoview.
Though, I have no experience with this :frowning:


Marek Chladny :slovakia: (BOB member since 2003-11-27)