BusinessObjects Board

Creating tabs based on a variable

Hello everyone…here is my problem I have a report which is sectioned by sales rep code…now i want each sales rep in one single tab in the same report.Can any one help me out…


pushkar :india: (BOB member since 2006-03-10)

Hi

As far as I am aware, you cannot automate this (unless perhaps by using VBA?)

But, if the number of sections is static and not too great, you could do it manually as follows:-

For each section name:

  • Right click on the tab and select Duplicate Report
    A new tab will appear.
  • Rename the new tab to something meaningful (e.g. the section name?)
  • Apply a filter to the table(s) on the new tab to restrict whatever variable you sectioned by to the value for this tab. For instance if your report was sectioned by customer and this tab is for “CUST A” then you would apply a filter = “CUSTA”

I hope this makes sense.

Although not, I suspect, what you wanted to hear. I guess you wanted to automatically split the report into dynamic tabs.

Richard


Richard Reeve :uk: (BOB member since 2003-01-07)

Thanks a lot…for time being i think that is a good idea…coz we donn have VBA feature installed…they got license for VBA n trying to install it…Any way thanks a lot for your time…


pushkar :india: (BOB member since 2006-03-10)

Hi Pushkar,

you need not have VBA installed seperately. It comes with Business Objects. Whne you install Business objects, VBA is also installed. Check in BO Reporter, when you open a report then go to Tools/Macro/Macros. This is where you write you VBA code for BO Reports.

Why do you want in seperate Tabs. Do the end user uses BO files? You can create the file in single tab and format it to display each “Sales rep Code” in New Page. if you still need in seperate Tab then you can use the VB Macros for that.


Raja Saripalli :us: (BOB member since 2005-12-14)

But it is disabled…i mean when i go to tools> macro> i see macros and VBE were disabled…i mean though i click on them it is of no use.


pushkar :india: (BOB member since 2006-03-10)

It probably means one of two things. It could be that your VBA privileges have been removed at the Supervisor level. The other possibility is that you are using a ZABO installation, and did not choose to install VBA support when you installed the software. A de-install / re-install should fix that problem.


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

Sample VBA code to accomplish this task can be found here.

I am going to move this topic to the SDK forum, since the solution requires VBA code.


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

is the code usable witnin Webi reports…

Regards - Paul


PaulR (BOB member since 2006-07-18)

Nope, sorry.


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

Hi Dwayne,

We have a requirement in similar terms i.e., depending on the prompt values selected the number of tabs to be displayed.

Thanks & Regards
Sriram


bouser1 (BOB member since 2008-08-01)

Hi Dwayne,
Many thanks for the code!

I am runnig the report+code in BO XI R2/SP2, and I am only able to refresh once. When I try to refresh the report again, I get Run-Time error on

Rpt.Name = Var.Values(boUniqueValues)(i)

line of the code.

Just putting the code below for refrence

Private Sub Document_AfterRefresh()

    Dim Rpt As Report
    Dim Var As DocumentVariable
    Dim i As Long

    Set Var = ThisDocument.DocumentVariables("Resort")
    If UBound(Var.Values(boUniqueValues)) > 0 Then
        Set Rpt = ThisDocument.Reports(1)
        For i = 1 To UBound(Var.Values(boUniqueValues))
            Set Rpt = Rpt.Duplicate
            Call Rpt.AddComplexFilter("Resort", "= <Resort> = """ &amp; _
                Var.Values(boUniqueValues)(i) &amp; """")
            Rpt.Name = Var.Values(boUniqueValues)(i)
        Next i
        Call ThisDocument.Reports(1).Delete
    End If

End Sub

Can you please suggest on this?

Thanks!
Ethan


ethan23 (BOB member since 2009-07-30)

It’s probably because a report tab with that name already exists in the document. Just start from a “clean” (single tab) copy of the report each time.


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