
Tips Recipes Brio 2002
Copyright © 2002, Brio Software Page 17
Section Type: Query section
Tip Name: Controlling the Drill Path
Purpose / Use: Sometimes you want to only show certain fields in a drill path, especially
when some fields are only used to build computed items and you don’t
want them included in drilling or even visible to users. In addition, you
may not want to use a Table section, since this would duplicate data.
Sample File: Drill path control.bqy
Steps to Produce: Add simple JavaScript code to the OnPostProcess and OnPreProcess
document events to remove the undesired fields from the Results section
after the query has processed and all computed items have been
calculated. (Requires Brio Intelligence v6.5.0 or higher.)
1) Build a data model and query as you normally would.
2) Use the File | Document Scripts… menu selection to enter the script editor for the BQY
document.
3) Select the OnPostProcess event from the pulldown menu at the top.
4) Enter code to remove the fields you want to hide from the Results section after the query
finishes processing. For example:
// Eliminate fields from the drill path
ActiveDocument.Sections["Results"].Columns["State"].Remove()
ActiveDocument.Sections["Results"].Columns["Date Ordered"].Remove()
5) Now select the OnPreProcess event and enter code to put the fields back into the Results
section just before processing the query. That way, any dependent computed items will be
properly refreshed. The corresponding code for the current example would be:
// Add the "hidden" fields so computed items can be recalced
ActiveDocument.Sections["Results"].Columns.Add("Date Ordered")
ActiveDocument.Sections["Results"].Columns.Add("State")
Comentarios a estos manuales