Try this on for size - -
----------------------------
A generic button script for Brio.
//MainPage def
var MainPage = "Siebel KB Report"
//Results page to show afterwards
Res = "R_KB"
//Queries to be run, limited ones first, in order of run if it matters
var NumQry = 1
var Qry = new Array(NumQry)
Qry[1] = "KB_Qry"
// last one to take user spec'ed limits
var LastLimitQry = 1
//Number of limits on the query to change, these should be the first limits
//if different queries in the set take different limits then I’ll have to modify this,
//it doesn’t handle that currently…
var NumLimits = 2
//Shapes we're going to get these limits from, organized by limit number
//i.e. the first limit on the query is start date, second end date and they get filled
//as specified by the shape below.
var Shp = new Array(NumLimits)
Shp[1] = "StartDate"
Shp[2] = "EndDate"
//You shouldn't have to change anything below here
//---------------------------------------------------------------------------
var SIndex = new Array(NumLimits)
var TmpVar = new Array(NumLimits)
for (j=1;j<=LastLimitQry;j++)
{
for (i=1;i<=NumLimits;i++)
{
ActiveDocument.Sections[Qry[j]].Limits.CustomValues.RemoveAll()
ActiveDocument.Sections[Qry[j]].Limits.SelectedValues.RemoveAll()
SIndex = ActiveDocument.Sections[MainPage].Shapes[Shp].SelectedIndex
TmpVar = ActiveDocument.Sections[MainPage].Shapes[Shp].Item(SIndex)
ActiveDocument.Sections[Qry[j]].Limits.CustomValues.Add(TmpVar)
ActiveDocument.Sections[Qry[j]].Limits.SelectedValues.Add(TmpVar)
}
}
for (i=1;i<=NumQry;i++)
{
ActiveDocument.Sections[Qry].Process()
}
ActiveDocument.Sections[Res].Activate()