BusinessObjects Board

Create report tab and filter for each value

Author: Dwayne Hoffpauir, EDS Corporation

Further discussion should take place in this topic.

The attached report uses VBA to create a separate report tab filtered for each value of a given field. The sample is based on the Island Resorts Marketing universe, and creates a separate report tab for each resort. The report tab name for each is changed to reflect the filtered value. The first tab is cloned as many times as needed, then the original tab is deleted from the document. The VBA code is included here for easier reference:

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

Report tab for each value.rep (50.0 KB)


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

Thanks Sir,

I will surely check

Regards,


ArunJAI (BOB member since 2008-12-28)

Hi,

Is it possible BOXI Webi 3.1?

Thanks.


sreenivas27 :india: (BOB member since 2007-01-03)

VBA unfortunetly can not be used/applied in Webi, only in Deski. :cry:


Captspeed :us: (BOB member since 2006-10-03)