Tuesday, 26 February 2013

Reading Hyperion Brio Filter Section using VB6

1. Declaration of brio object & document.

Dim mybrioobj As New BrioQry.Application
Dim myDdoc As BrioQry.Document


2. Openning brio file from the location "path".

Set myDdoc = mybrioobj.Documents.Open(path)



3. Create Query Section object, Section name is the name of the query section. A brio file can have query section, filter result/table section, pivot & dashboard.

Dim qry As BrioQry.QuerySection
Set qry = mySdoc.Sections(SectionName)


4. Looping all Filter/Limit items

 For l = 1 To qry.Limits.Count
               LimitName= qry.Limits(l).DisplayName
               LimitSQL = qry.Limits(l).CustomSQL
               For i = 1 To qry.Limits(l).CustomValues.Count
                       LimitCustomValues(i) = qry.Limits(l).CustomValues(i)
               Next
               ReqLimits(l).intMaxCustomVal = qry.Limits(l).CustomValues.Count
               For i = 1 To qry.Limits(l).SelectedValues.Count
                      LimitSelectedValues(i)= qry.Limits(l).SelectedValues(i)
               Next
               MaxSelectedVal = qry.Limits(l).SelectedValues.Count
             
               Operator= qry.Limits(l).Operator
               IgnoreLimit = qry.Limits(l).Ignore
               NegateLimit = qry.Limits(l).Negate
               LogicalOperator = qry.Limits(l).LogicalOperator
               ValueType = qry.Limits(l).LimitValueType
               isNull = qry.Limits(l).IncludeNulls
              
               For i = 1 To qry.Limits.Parentheses.Count
                     limParenthesis(i).parcount = qry.Limits.Parentheses.Count
                     limParenthesis(i).parstartlim = qry.Limits.Parentheses(i).BeginLimitName
                     limParenthesis(i).parendlim = qry.Limits.Parentheses(i).EndLimitName
                     limParenthesis(i).parname = qry.Limits.Parentheses(i).name
               Next
     Next



4. Closing Objects

 myDdoc.Close                                'or     mybrioobj.ActiveDocument.Close
 mybrioobj.Quit
 Set mybrioobj = Nothing

No comments:

Post a Comment